-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMpPaystack.php
39 lines (36 loc) · 1.01 KB
/
MpPaystack.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
<?php
if (!defined('ABSPATH')) {
die('You are not allowed to call this page directly.');
}
/*
Integration of Paystack into MemberPress
*/
class MpPaystack
{
public function __construct()
{
// Add Gateway Path
add_filter('mepr-gateway-paths', array($this, 'add_mepr_gateway_paths'));
// Add Option Scripts
add_action('mepr-options-admin-enqueue-script', array($this, 'add_options_admin_enqueue_script'));
}
//Add Paystack path to general gateway page
public function add_mepr_gateway_paths($tabs)
{
array_push($tabs, MP_PAYSTACK_PATH);
return $tabs;
}
public static function add_options_admin_enqueue_script($hook)
{
if ($hook == 'memberpress_page_memberpress-options') {
wp_enqueue_script(
'mp-paystack-options-js',
MP_PAYSTACK_JS_URL . '/admin_options.js',
array(
'jquery',
)
);
return $hook;
}
}
}