- Timestamp:
- 03/23/2023 07:35:38 PM (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/classes/class-bp-xprofile-component.php
r13432 r13441 230 230 public function setup_nav( $main_nav = array(), $sub_nav = array() ) { 231 231 232 // Determine user to use. 233 if ( bp_displayed_user_domain() ) { 234 $user_domain = bp_displayed_user_domain(); 235 } elseif ( bp_loggedin_user_domain() ) { 236 $user_domain = bp_loggedin_user_domain(); 237 } else { 232 // Stop if there is no user displayed or logged in. 233 if ( ! is_user_logged_in() && ! bp_displayed_user_id() ) { 238 234 return; 239 235 } 240 236 241 $access = bp_core_can_edit_settings(); 242 $slug = bp_get_profile_slug(); 243 $profile_link = trailingslashit( $user_domain . $slug ); 237 $access = bp_core_can_edit_settings(); 238 $slug = bp_get_profile_slug(); 244 239 245 240 // Add 'Profile' to the main navigation. … … 257 252 'name' => _x( 'View', 'Profile header sub menu', 'buddypress' ), 258 253 'slug' => 'public', 259 'parent_url' => $profile_link,260 254 'parent_slug' => $slug, 261 255 'screen_function' => 'xprofile_screen_display_profile', … … 267 261 'name' => _x( 'Edit','Profile header sub menu', 'buddypress' ), 268 262 'slug' => 'edit', 269 'parent_url' => $profile_link,270 263 'parent_slug' => $slug, 271 264 'screen_function' => 'xprofile_screen_edit_profile', … … 294 287 } 295 288 296 // Determine user to use. 297 if ( bp_displayed_user_domain() ) { 298 $user_domain = bp_displayed_user_domain(); 299 } elseif ( bp_loggedin_user_domain() ) { 300 $user_domain = bp_loggedin_user_domain(); 301 } else { 289 // Stop if there is no user displayed or logged in. 290 if ( ! is_user_logged_in() && ! bp_displayed_user_id() ) { 302 291 return; 303 292 } … … 309 298 'name' => _x( 'Profile Visibility', 'Profile settings sub nav', 'buddypress' ), 310 299 'slug' => 'profile', 311 'parent_url' => trailingslashit( $user_domain . $settings_slug ),312 300 'parent_slug' => $settings_slug, 313 301 'screen_function' => 'bp_xprofile_screen_settings',
Note: See TracChangeset
for help on using the changeset viewer.