Changeset 13441 for trunk/src/bp-blogs/classes/class-bp-blogs-component.php
- Timestamp:
- 03/23/2023 07:35:38 PM (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-blogs/classes/class-bp-blogs-component.php
r13436 r13441 219 219 } 220 220 221 // Determine user to use. 222 if ( bp_displayed_user_domain() ) { 223 $user_domain = bp_displayed_user_domain(); 224 } elseif ( bp_loggedin_user_domain() ) { 225 $user_domain = bp_loggedin_user_domain(); 226 } else { 221 // Stop if there is no user displayed or logged in. 222 if ( ! is_user_logged_in() && ! bp_displayed_user_id() ) { 227 223 return; 228 224 } 229 225 230 226 $slug = bp_get_blogs_slug(); 231 $parent_url = trailingslashit( $user_domain . $slug );232 227 233 228 // Add 'Sites' to the main navigation. … … 255 250 'name' => __( 'My Sites', 'buddypress' ), 256 251 'slug' => 'my-sites', 257 'parent_url' => $parent_url,258 252 'parent_slug' => $slug, 259 253 'screen_function' => 'bp_blogs_screen_my_blogs', … … 290 284 291 285 // Setup the logged in user variables. 292 $blogs_link = trailingslashit( bp_loggedin_user_domain() . bp_get_blogs_slug() ); 286 $blogs_slug = bp_get_blogs_slug(); 287 $custom_blogs_slug = bp_rewrites_get_slug( 'members', 'member_' . $blogs_slug, $blogs_slug ); 293 288 294 289 // Add the "Sites" sub menu. … … 297 292 'id' => 'my-account-' . $this->id, 298 293 'title' => __( 'Sites', 'buddypress' ), 299 'href' => $blogs_link 294 'href' => bp_loggedin_user_url( 295 array( 296 'single_item_component' => $custom_blogs_slug, 297 ) 298 ), 300 299 ); 301 300 … … 305 304 'id' => 'my-account-' . $this->id . '-my-sites', 306 305 'title' => __( 'My Sites', 'buddypress' ), 307 'href' => trailingslashit( $blogs_link . 'my-sites' ), 308 'position' => 10 306 'href' => bp_loggedin_user_url( 307 array( 308 'single_item_component' => $custom_blogs_slug, 309 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $blogs_slug . '_my_sites', 'my-sites' ), 310 ) 311 ), 312 'position' => 10, 309 313 ); 310 314
Note: See TracChangeset
for help on using the changeset viewer.