Changeset 13404 for trunk/src/bp-members/classes/class-bp-members-admin.php
- Timestamp:
- 01/09/2023 12:24:49 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-members/classes/class-bp-members-admin.php
r13169 r13404 55 55 56 56 /** 57 * Redirect. 58 * 59 * @since 2.0.0 60 * @var string 61 */ 62 public $redirect; 63 64 /** 57 65 * Screen id for edit user's profile page. 58 66 * 67 * @since 2.0.0 59 68 * @var string 60 69 */ … … 62 71 63 72 /** 64 * Setup BP Members Admin. 65 * 66 * @since 2.0.0 67 * 68 * @return BP_Members_Admin 69 */ 70 public static function register_members_admin() { 71 if ( ! is_admin() ) { 72 return; 73 } 74 75 $bp = buddypress(); 76 77 if ( empty( $bp->members->admin ) ) { 78 $bp->members->admin = new self; 79 } 80 81 return $bp->members->admin; 82 } 73 * User capability. 74 * 75 * @since 2.0.0 76 * @var string 77 */ 78 public $capability; 79 80 /** 81 * Show Profile Screen id. 82 * 83 * @since 2.0.0 84 * @var string 85 */ 86 public $user_profile; 87 88 /** 89 * Current user ID. 90 * 91 * @since 2.0.0 92 * @var int 93 */ 94 public $current_user_id; 95 96 /** 97 * User ID being edited. 98 * 99 * @since 2.0.0 100 * @var int 101 */ 102 public $user_id = 0; 103 104 /** 105 * Is a member editing their own profile. 106 * 107 * @since 2.0.0 108 * @var bool 109 */ 110 public $is_self_profile = false; 111 112 /** 113 * The screen ids to load specific css for. 114 * 115 * @since 2.0.0 116 * @var array 117 */ 118 public $screen_id = array(); 119 120 /** 121 * The stats metabox default position. 122 * 123 * @since 2.0.0 124 * @var stdClass 125 */ 126 public $stats_metabox; 127 128 /** 129 * Edit user's profile args. 130 * 131 * @since 2.0.0 132 * @var array 133 */ 134 public $edit_profile_args; 135 136 /** 137 * Edit user's profile URL. 138 * 139 * @since 2.0.0 140 * @var string 141 */ 142 public $edit_profile_url = ''; 143 144 /** 145 * Edit URL. 146 * 147 * @since 2.0.0 148 * @var string 149 */ 150 public $edit_url = ''; 151 152 /** 153 * Users page. 154 * 155 * @since 2.0.0 156 * @var string 157 */ 158 public $users_page = ''; 159 160 /** 161 * Signups page. 162 * 163 * @since 2.0.0 164 * @var string 165 */ 166 public $signups_page = ''; 167 168 /** 169 * Users URL. 170 * 171 * @since 2.0.0 172 * @var string 173 */ 174 public $users_url; 175 176 /** 177 * Users screen. 178 * 179 * @since 2.0.0 180 * @var string 181 */ 182 public $users_screen; 183 184 /** 185 * Members' Invite Page. 186 * 187 * @since 2.0.0 188 * @var string 189 */ 190 public $members_invites_page = ''; 191 192 /** 193 * Status of BuddyPress network. 194 * 195 * @since 2.0.0 196 * @var bool 197 */ 198 public $subsite_activated; 199 200 /** 201 * Tools menu. 202 * 203 * @since 2.0.0 204 * @var string 205 */ 206 public $tools_parent = 'tools.php'; 83 207 84 208 /** … … 101 225 102 226 // Paths and URLs 103 $this->admin_dir = trailingslashit( $bp->plugin_dir 104 $this->admin_url = trailingslashit( $bp->plugin_url 227 $this->admin_dir = trailingslashit( $bp->plugin_dir . 'bp-members/admin' ); // Admin path. 228 $this->admin_url = trailingslashit( $bp->plugin_url . 'bp-members/admin' ); // Admin URL. 105 229 $this->css_url = trailingslashit( $this->admin_url . 'css' ); // Admin CSS URL. 106 230 $this->js_url = trailingslashit( $this->admin_url . 'js' ); // Admin CSS URL. … … 109 233 $this->capability = bp_core_do_network_admin() ? 'manage_network_users' : 'edit_users'; 110 234 111 // The Edit Profile Screen id.112 $this->user_page = '';113 114 235 // The Show Profile Screen id. 115 236 $this->user_profile = is_network_admin() ? 'users' : 'profile'; … … 118 239 $this->current_user_id = get_current_user_id(); 119 240 120 // The user id being edited.121 $this->user_id = 0;122 123 // Is a member editing their own profile.124 $this->is_self_profile = false;125 126 // The screen ids to load specific css for.127 $this->screen_id = array();128 129 241 // The stats metabox default position. 130 $this->stats_metabox = new StdClass();242 $this->stats_metabox = new stdClass(); 131 243 132 244 // BuddyPress edit user's profile args. 133 245 $this->edit_profile_args = array( 'page' => 'bp-profile-edit' ); 134 $this->edit_profile_url = '';135 $this->edit_url = '';136 246 137 247 // Data specific to signups. 138 $this->users_page = '';139 $this->signups_page = '';140 248 $this->users_url = bp_get_admin_url( 'users.php' ); 141 249 $this->users_screen = bp_core_do_network_admin() ? 'users-network' : 'users'; 142 143 $this->members_invites_page = '';144 250 145 251 // Specific config: BuddyPress is not network activated. … … 157 263 if ( is_multisite() && bp_core_do_network_admin() ) { 158 264 $this->tools_parent = 'network-tools'; 159 } else {160 $this->tools_parent = 'tools.php';161 265 } 162 266 } … … 169 273 private function setup_actions() { 170 274 171 /** Extended Profile ************************************************* 172 */ 275 /** Extended Profile **************************************************/ 173 276 174 277 // Enqueue all admin JS and CSS. … … 305 408 ) ); 306 409 } 410 } 411 412 /** 413 * Setup BP Members Admin. 414 * 415 * @since 2.0.0 416 * 417 * @return BP_Members_Admin|null 418 */ 419 public static function register_members_admin() { 420 if ( ! is_admin() ) { 421 return null; 422 } 423 424 $bp = buddypress(); 425 426 if ( empty( $bp->members->admin ) ) { 427 $bp->members->admin = new self; 428 } 429 430 return $bp->members->admin; 307 431 } 308 432 … … 456 580 * 457 581 * @since 2.1.0 458 *459 582 */ 460 583 public function user_profile_menu() { … … 493 616 * 494 617 * @since 2.0.0 495 *496 618 */ 497 619 public function admin_menus() {
Note: See TracChangeset
for help on using the changeset viewer.