Changeset 8610 for trunk/src/bp-xprofile/bp-xprofile-loader.php
- Timestamp:
- 07/12/2014 03:01:27 AM (11 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-xprofile/bp-xprofile-loader.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/bp-xprofile-loader.php
r8568 r8610 219 219 } 220 220 221 // Privacy Settings 222 if ( bp_is_active( 'settings' ) ) { 223 224 // Get the settings slug 225 $settings_slug = bp_get_settings_slug(); 226 227 // Add the sub-navigation 228 $sub_nav[] = array( 229 'name' => __( 'Profile', 'buddypress' ), 230 'slug' => 'profile', 231 'parent_url' => trailingslashit( $user_domain . $settings_slug ), 232 'parent_slug' => $settings_slug, 233 'screen_function' => 'bp_xprofile_screen_settings', 234 'position' => 30, 235 'user_has_access' => bp_core_can_edit_settings() 236 ); 237 } 221 // The Settings > Profile nav item can only be set up after 222 // the Settings component has run its own nav routine 223 add_action( 'bp_settings_setup_nav', array( $this, 'setup_settings_nav' ) ); 238 224 239 225 parent::setup_nav( $main_nav, $sub_nav ); 226 } 227 228 /** 229 * Set up the Settings > Profile nav item. 230 * 231 * Loaded in a separate method because the Settings component may not 232 * be loaded in time for BP_XProfile_Component::setup_nav(). 233 * 234 * @since BuddyPress (2.1.0) 235 */ 236 public function setup_settings_nav() { 237 if ( ! bp_is_active( 'settings' ) ) { 238 return; 239 } 240 241 // Determine user to use 242 if ( bp_displayed_user_domain() ) { 243 $user_domain = bp_displayed_user_domain(); 244 } elseif ( bp_loggedin_user_domain() ) { 245 $user_domain = bp_loggedin_user_domain(); 246 } else { 247 return; 248 } 249 250 // Get the settings slug 251 $settings_slug = bp_get_settings_slug(); 252 253 bp_core_new_subnav_item( array( 254 'name' => __( 'Profile', 'buddypress' ), 255 'slug' => 'profile', 256 'parent_url' => trailingslashit( $user_domain . $settings_slug ), 257 'parent_slug' => $settings_slug, 258 'screen_function' => 'bp_xprofile_screen_settings', 259 'position' => 30, 260 'user_has_access' => bp_core_can_edit_settings() 261 ) ); 240 262 } 241 263 … … 355 377 $bp->profile = new BP_XProfile_Component(); 356 378 } 357 add_action( 'bp_setup_components', 'bp_setup_xprofile', 6);379 add_action( 'bp_setup_components', 'bp_setup_xprofile', 2 );
Note: See TracChangeset
for help on using the changeset viewer.