-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathclass-manager.php
executable file
·146 lines (131 loc) · 2.12 KB
/
class-manager.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?php
/**
* Class BPPL_Manager
*
* @since 1.0.0
*
* This class manages the objects which have to be started for plugin functionality
*/
if( ! defined( 'ABSPATH' ) ) {
exit;
}
class BPPL_Manager{
/**
* Plugin object holder
*
* @since 1.0.0
*
* @var BPPL_Loader
*/
private $plugin = null;
/**
* User object holder
*
* @since 1.0.0
*
* @var BPPL_User
*/
private $user = null;
/**
* Polylang object holder
*
* @since 1.0.0
*
* @var BPPL_Polylang
*/
private $polylang = null;
/**
* BuddyPress object holder
*
* @since 1.0.0
*
* @var BPPL_BuddyPress
*/
private $buddypress = null;
/**
* Email object holder
*
* @since 1.0.0
*
* @var BPPL_BuddyPress_Emails
*/
private $buddypress_emails = null;
/**
* Instance
*
* @since 1.0.0
*
* @var BPPL_Manager $instance ;
*/
protected static $instance = null;
/**
* BuddyPress_Polylang constructor
*
* @since 1.0.0
*/
private function __construct() {
$this->plugin = new BPPL_Loader();
$this->user = new BPPL_User();
$this->polylang = new BPPL_Polylang();
$this->buddypress = new BPPL_BuddyPress();
$this->buddypress_emails = new BPPL_BuddyPress_Emails();
}
/**
* Getting instance
*
* @since 1.0.0
*
* @return BPPL_Manager $instance
*/
public static function get_instance() {
if ( null === static::$instance ) {
static::$instance = new static;
}
return static::$instance;
}
/**
* User object
*
* @since 1.0.0
*
* @param int $user_id User ID
*
* @return BPPL_User
*/
public function user( $user_id = null ) {
if( ! empty( $user_id ) ) {
$this->user->set_user( $user_id );
}
return $this->user;
}
/**
* Polylang object
*
* @since 1.0.0
*
* @return BPPL_Polylang
*/
public function polylang() {
return $this->polylang;
}
/**
* BuddyPress object
*
* @since 1.0.0
*
* @return BPPL_BuddyPress
*/
public function buddypress() {
return $this->buddypress;
}
/**
* BuddyPress Emails object
*
* @since 1.0.0
*
* @return BPPL_BuddyPress_Emails
*/
public function buddypress_emails() {
return $this->buddypress_emails;
}
}