-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlearnpress-zarinpal.php
More file actions
71 lines (64 loc) · 2.05 KB
/
learnpress-zarinpal.php
File metadata and controls
71 lines (64 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
/*
Plugin Name: Zarinpal payment gateway for LearnPress
Description: Zarinpal payment gateway for LearnPress.
Author: erfan darvishnia
Link: https://zarinpal.com
Version: 1.1
Author URI: https://github.com/erfanad1992
Tags: learnpress,zarinpal,gateway,payment,زیبال,lms,لرن پرس
Text Domain: learnpress-zarinpal
Domain Path: /languages/
*/
// Prevent loading this file directly
defined( 'ABSPATH' ) || exit;
define( 'LP_ADDON_ZARINPAL_PAYMENT_FILE', __FILE__ );
define( 'LP_ADDON_ZARINPAL_PAYMENT_VER', '1.0.0' );
define( 'LP_ADDON_ZARINPAL_PAYMENT_REQUIRE_VER', '1.0.0' );
/**
* Class LP_Addon_Zarinpal_Payment_Preload
*/
class LP_Addon_Zarinpal_Payment_Preload {
/**
* LP_Addon_Zarinpal_Payment_Preload constructor.
*/
public function __construct() {
load_plugin_textdomain( 'learnpress-zarinpal', false, basename( dirname(__FILE__) ) . '/languages' );
add_action( 'learn-press/ready', array( $this, 'load' ) );
add_action( 'admin_notices', array( $this, 'admin_notices' ) );
}
/**
* Load addon
*/
public function load() {
LP_Addon::load( 'LP_Addon_Zarinpal_Payment', 'inc/load.php', __FILE__ );
remove_action( 'admin_notices', array( $this, 'admin_notices' ) );
}
/**
* Admin notice
*/
public function admin_notices() {
?>
<div class="error">
<p><?php echo wp_kses(
sprintf(
__( '<strong>%s</strong> addon version %s requires %s version %s or higher is <strong>installed</strong> and <strong>activated</strong>.', 'learnpress-zarinpal' ),
__( 'LearnPress Zarinpal Payment', 'learnpress-zarinpal' ),
LP_ADDON_ZARINPAL_PAYMENT_VER,
sprintf( '<a href="%s" target="_blank"><strong>%s</strong></a>', admin_url( 'plugin-install.php?tab=search&type=term&s=learnpress' ), __( 'LearnPress', 'learnpress-zarinpal' ) ),
LP_ADDON_ZARINPAL_PAYMENT_REQUIRE_VER
),
array(
'a' => array(
'href' => array(),
'blank' => array()
),
'strong' => array()
)
); ?>
</p>
</div>
<?php
}
}
new LP_Addon_Zarinpal_Payment_Preload();