Changeset 9936 for trunk/src/bp-xprofile/bp-xprofile-loader.php
- Timestamp:
- 06/11/2015 06:53:59 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/bp-xprofile-loader.php
r9819 r9936 172 172 public function setup_nav( $main_nav = array(), $sub_nav = array() ) { 173 173 174 $sub_nav = array(); 174 // Determine user to use 175 if ( bp_displayed_user_domain() ) { 176 $user_domain = bp_displayed_user_domain(); 177 } elseif ( bp_loggedin_user_domain() ) { 178 $user_domain = bp_loggedin_user_domain(); 179 } else { 180 return; 181 } 182 183 $slug = 184 $profile_link = trailingslashit( $user_domain . $this->slug ); 175 185 176 186 // Add 'Profile' to the main navigation … … 183 193 'item_css_id' => $this->id 184 194 ); 185 186 // Determine user to use187 if ( bp_displayed_user_domain() ) {188 $user_domain = bp_displayed_user_domain();189 } elseif ( bp_loggedin_user_domain() ) {190 $user_domain = bp_loggedin_user_domain();191 } else {192 return;193 }194 195 $profile_link = trailingslashit( $user_domain . $this->slug );196 195 197 196 // Add the subnav items to the profile … … 276 275 */ 277 276 public function setup_admin_bar( $wp_admin_nav = array() ) { 278 $bp = buddypress();279 280 // Prevent debug notices281 $wp_admin_nav = array();282 277 283 278 // Menus for logged in user … … 285 280 286 281 // Profile link 287 $profile_link = trailingslashit( bp_loggedin_user_domain() . $this->slug);282 $profile_link = trailingslashit( bp_loggedin_user_domain() . bp_get_profile_slug() ); 288 283 289 284 // Add the "Profile" sub menu 290 285 $wp_admin_nav[] = array( 291 'parent' => $bp->my_account_menu_id,286 'parent' => buddypress()->my_account_menu_id, 292 287 'id' => 'my-account-' . $this->id, 293 288 'title' => _x( 'Profile', 'My Account Profile', 'buddypress' ), 294 'href' => trailingslashit( $profile_link )289 'href' => $profile_link 295 290 ); 296 291 … … 300 295 'id' => 'my-account-' . $this->id . '-public', 301 296 'title' => _x( 'View', 'My Account Profile sub nav', 'buddypress' ), 302 'href' => trailingslashit( $profile_link . 'public' )297 'href' => $profile_link 303 298 ); 304 299 … … 339 334 */ 340 335 public function setup_title() { 341 $bp = buddypress();342 336 343 337 if ( bp_is_profile_component() ) { 338 $bp = buddypress(); 339 344 340 if ( bp_is_my_profile() ) { 345 341 $bp->bp_options_title = _x( 'My Profile', 'Page title', 'buddypress' ); … … 384 380 */ 385 381 public function setup_settings_admin_nav( $wp_admin_nav ) { 382 386 383 // Setup the logged in user variables 387 384 $settings_link = trailingslashit( bp_loggedin_user_domain() . bp_get_settings_slug() );
Note: See TracChangeset
for help on using the changeset viewer.