-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwixbu-dash.php
executable file
·119 lines (95 loc) · 3.16 KB
/
wixbu-dash.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<?php
/*
Plugin Name: Wixbu dashboard
Plugin URI: http://shramee.me/
Description: Simple plugin starter for quick delivery
Author: Shramee
Version: 1.0.0
Author URI: http://shramee.me/
@developer shramee <shramee.srivastav@gmail.com>
*/
/** Plugin admin class */
require 'inc/class-admin.php';
/** Plugin public class */
require 'inc/class-public.php';
/**
* Wixbu dashboard main class
* @static string $token Plugin token
* @static string $file Plugin __FILE__
* @static string $url Plugin root dir url
* @static string $path Plugin root dir path
* @static string $version Plugin version
*/
class Wixbu_Dash{
/** @var Wixbu_Dash Instance */
private static $_instance = null;
/** @var string Token */
public static $token;
/** @var string Version */
public static $version;
/** @var string Plugin main __FILE__ */
public static $file;
/** @var string Plugin directory url */
public static $url;
/** @var string Plugin directory path */
public static $path;
/** @var array Dashboard tabs */
public static $tabs;
/** @var string Account page URL */
public static $ac_page_url;
/** @var Wixbu_Dash_Admin Instance */
public $admin;
/** @var Wixbu_Dash_Public Instance */
public $public;
/**
* Return class instance
* @return Wixbu_Dash instance
*/
public static function instance( $file ) {
if ( null == self::$_instance ) {
self::$_instance = new self( $file );
}
return self::$_instance;
}
/**
* Constructor function.
* @param string $file __FILE__ of the main plugin
* @access private
* @since 1.0.0
*/
private function __construct( $file ) {
self::$token = 'wixbu-dash';
self::$file = $file;
self::$url = plugin_dir_url( $file );
self::$path = plugin_dir_path( $file );
self::$version = '1.0.0';
$this->_admin(); //Initiate admin
$this->_public(); //Initiate public
}
/**
* Initiates admin class and adds admin hooks
*/
private function _admin() {
//Instantiating admin class
$this->admin = Wixbu_Dash_Admin::instance();
//Enqueue admin end JS and CSS
add_action( 'wp_ajax_wixbu_delete_user', array( $this->admin, 'wp_ajax_wixbu_delete_user' ) );
}
/**
* Initiates public class and adds public hooks
*/
private function _public() {
//Instantiating public class
$this->public = Wixbu_Dash_Public::instance();
//Enqueue front end JS and CSS
add_action( 'wp_enqueue_scripts', array( $this->public, 'enqueue' ) );
add_filter( 'llms_get_student_dashboard_tabs', array( $this->public, 'llms_get_student_dashboard_tabs' ), 9 );
add_filter( 'llms_student_dashboard_default_tab', array( $this->public, 'llms_student_dashboard_default_tab' ) );
add_filter( 'lifterlms_before_student_dashboard_content', array( $this->public, 'lifterlms_before_student_dashboard_content' ), 25 );
add_filter( 'lifterlms_after_student_dashboard', array( $this->public, 'lifterlms_after_student_dashboard' ), 5 );
add_filter( 'lifterlms_get_person_fields', array( $this->public, 'lifterlms_get_person_fields' ), 99, 2 );
add_filter( 'lifterlms_update_account_redirect', array( $this->public, 'lifterlms_update_account_redirect' ), 99, 2 );
}
}
/** Intantiating main plugin class */
Wixbu_Dash::instance( __FILE__ );