-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEE_Paysera_Payment_Method.class.php
81 lines (73 loc) · 2.51 KB
/
EE_Paysera_Payment_Method.class.php
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
72
73
74
75
76
77
78
79
80
81
<?php if ( ! defined( 'EVENT_ESPRESSO_VERSION' )) { exit(); }
/**
* ------------------------------------------------------------------------
*
* Class EE_Paysera_Payment_Method
*
* @package Event Espresso
* @subpackage espresso-new-payment-method
* @author Vasily Ogar
* @version 0.0.1
*
* ------------------------------------------------------------------------
*/
// define the plugin directory path and URL
define( 'EE_PAYSERA_PAYMENT_METHOD_BASENAME', plugin_basename( EE_PAYSERA_PAYMENT_METHOD_PLUGIN_FILE ));
define( 'EE_PAYSERA_PAYMENT_METHOD_PATH', plugin_dir_path( __FILE__ ));
define( 'EE_PAYSERA_PAYMENT_METHOD_URL', plugin_dir_url( __FILE__ ));
Class EE_Paysera_Payment_Method extends EE_Addon {
/**
* class constructor
*/
public function __construct() {
}
public static function register_addon() {
// register addon via Plugin API
EE_Register_Addon::register(
'Paysera_Payment_Method',
array(
'version' => EE_PAYSERA_PAYMENT_METHOD_VERSION,
'min_core_version' => '4.6.0.dev.000',
'main_file_path' => EE_PAYSERA_PAYMENT_METHOD_PLUGIN_FILE,
// if plugin update engine is being used for auto-updates. not needed if PUE is not being used.
// 'pue_options' => array(
// 'pue_plugin_slug' => 'espresso_paysera_payment_method',
// 'plugin_basename' => EE_PAYSERA_PAYMENT_METHOD_BASENAME,
// 'checkPeriod' => '24',
// 'use_wp_update' => FALSE,
// ),
'payment_method_paths' => array(
EE_PAYSERA_PAYMENT_METHOD_PATH . 'Paysera_Payment_Method'
),
));
}
/**
* additional_admin_hooks
*
* @access public
* @return void
*/
public function additional_admin_hooks() {
// is admin and not in M-Mode ?
if ( is_admin() && ! EE_Maintenance_Mode::instance()->level() ) {
add_filter( 'plugin_action_links', array( $this, 'plugin_actions' ), 10, 2 );
}
}
/**
* plugin_actions
*
* Add a settings link to the Plugins page, so people can go straight from the plugin page to the settings page.
* @param $links
* @param $file
* @return array
*/
public function plugin_actions( $links, $file ) {
if ( $file == EE_PAYSERA_PAYMENT_METHOD_BASENAME ) {
// before other links
array_unshift( $links, '<a href="admin.php?page=espresso_payments">' . __('Settings') . '</a>' );
}
return $links;
}
}
// End of file EE_Paysera_Payment_Method.class.php
// Location: wp-content/plugins/espresso-paysera-payment/EE_Paysera_Payment_Method.class.php