- Timestamp:
- 03/23/2023 07:35:38 PM (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/classes/class-bp-activity-component.php
r13432 r13441 255 255 } 256 256 257 // Determine user to use. 258 if ( bp_displayed_user_domain() ) { 259 $user_domain = bp_displayed_user_domain(); 260 } elseif ( bp_loggedin_user_domain() ) { 261 $user_domain = bp_loggedin_user_domain(); 262 } else { 263 return; 264 } 265 266 $slug = bp_get_activity_slug(); 267 $activity_link = trailingslashit( $user_domain . $slug ); 257 $slug = bp_get_activity_slug(); 268 258 269 259 // Add 'Activity' to the main navigation. … … 281 271 'name' => _x( 'Personal', 'Profile activity screen sub nav', 'buddypress' ), 282 272 'slug' => 'just-me', 283 'parent_url' => $activity_link,284 273 'parent_slug' => $slug, 285 274 'screen_function' => 'bp_activity_screen_my_activity', … … 292 281 'name' => _x( 'Mentions', 'Profile activity screen sub nav', 'buddypress' ), 293 282 'slug' => 'mentions', 294 'parent_url' => $activity_link,295 283 'parent_slug' => $slug, 296 284 'screen_function' => 'bp_activity_screen_mentions', … … 305 293 'name' => _x( 'Favorites', 'Profile activity screen sub nav', 'buddypress' ), 306 294 'slug' => 'favorites', 307 'parent_url' => $activity_link,308 295 'parent_slug' => $slug, 309 296 'screen_function' => 'bp_activity_screen_favorites', … … 318 305 'name' => _x( 'Friends', 'Profile activity screen sub nav', 'buddypress' ), 319 306 'slug' => bp_get_friends_slug(), 320 'parent_url' => $activity_link,321 307 'parent_slug' => $slug, 322 308 'screen_function' => 'bp_activity_screen_friends', … … 331 317 'name' => _x( 'Groups', 'Profile activity screen sub nav', 'buddypress' ), 332 318 'slug' => bp_get_groups_slug(), 333 'parent_url' => $activity_link,334 319 'parent_slug' => $slug, 335 320 'screen_function' => 'bp_activity_screen_groups', … … 359 344 360 345 // Setup the logged in user variables. 361 $activity_link = trailingslashit( bp_loggedin_user_domain() . bp_get_activity_slug() ); 346 $activity_slug = bp_get_activity_slug(); 347 $custom_activity_slug = bp_rewrites_get_slug( 'members', 'member_' . $activity_slug, $activity_slug ); 362 348 363 349 // Unread message count. … … 380 366 'id' => 'my-account-' . $this->id, 381 367 'title' => _x( 'Activity', 'My Account Activity sub nav', 'buddypress' ), 382 'href' => $activity_link 368 'href' => bp_loggedin_user_url( 369 array( 370 'single_item_component' => $custom_activity_slug, 371 ) 372 ), 383 373 ); 384 374 … … 388 378 'id' => 'my-account-' . $this->id . '-personal', 389 379 'title' => _x( 'Personal', 'My Account Activity sub nav', 'buddypress' ), 390 'href' => trailingslashit( $activity_link . 'just-me' ), 391 'position' => 10 380 'href' => bp_loggedin_user_url( 381 array( 382 'single_item_component' => $custom_activity_slug, 383 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_just_me', 'just-me' ), 384 ) 385 ), 386 'position' => 10, 392 387 ); 393 388 … … 398 393 'id' => 'my-account-' . $this->id . '-mentions', 399 394 'title' => $title, 400 'href' => trailingslashit( $activity_link . 'mentions' ), 401 'position' => 20 395 'href' => bp_loggedin_user_url( 396 array( 397 'single_item_component' => $custom_activity_slug, 398 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_mentions', 'mentions' ), 399 ) 400 ), 401 'position' => 20, 402 402 ); 403 403 } … … 409 409 'id' => 'my-account-' . $this->id . '-favorites', 410 410 'title' => _x( 'Favorites', 'My Account Activity sub nav', 'buddypress' ), 411 'href' => trailingslashit( $activity_link . 'favorites' ), 412 'position' => 30 411 'href' => bp_loggedin_user_url( 412 array( 413 'single_item_component' => $custom_activity_slug, 414 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_favorites', 'favorites' ), 415 ) 416 ), 417 'position' => 30, 413 418 ); 414 419 } … … 416 421 // Friends? 417 422 if ( bp_is_active( 'friends' ) ) { 423 $friends_slug = bp_get_friends_slug(); 418 424 $wp_admin_nav[] = array( 419 425 'parent' => 'my-account-' . $this->id, 420 426 'id' => 'my-account-' . $this->id . '-friends', 421 427 'title' => _x( 'Friends', 'My Account Activity sub nav', 'buddypress' ), 422 'href' => trailingslashit( $activity_link . bp_get_friends_slug() ), 423 'position' => 40 428 'href' => bp_loggedin_user_url( 429 array( 430 'single_item_component' => $custom_activity_slug, 431 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_' . $friends_slug, $friends_slug ), 432 ) 433 ), 434 'position' => 40, 424 435 ); 425 436 } … … 427 438 // Groups? 428 439 if ( bp_is_active( 'groups' ) ) { 440 $groups_slug = bp_get_groups_slug(); 429 441 $wp_admin_nav[] = array( 430 442 'parent' => 'my-account-' . $this->id, 431 443 'id' => 'my-account-' . $this->id . '-groups', 432 444 'title' => _x( 'Groups', 'My Account Activity sub nav', 'buddypress' ), 433 'href' => trailingslashit( $activity_link . bp_get_groups_slug() ), 445 'href' => bp_loggedin_user_url( 446 array( 447 'single_item_component' => $custom_activity_slug, 448 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_' . $groups_slug, $groups_slug ), 449 ) 450 ), 434 451 'position' => 50 435 452 );
Note: See TracChangeset
for help on using the changeset viewer.