Changeset 13503
- Timestamp:
- 06/18/2023 04:11:04 AM (16 months ago)
- Location:
- trunk
- Files:
-
- 56 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/actions/feeds.php
r13443 r13503 55 55 } 56 56 57 $activity_slug = bp_get_activity_slug(); 58 $link = bp_displayed_user_url( 59 array( 60 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug, $activity_slug ), 61 ) 62 ); 57 $link = bp_displayed_user_url( bp_members_get_path_chunks( array( bp_get_activity_slug() ) ) ); 63 58 64 59 // Setup the feed. … … 95 90 } 96 91 97 $activity_slug = bp_get_activity_slug(); 98 $friends_slug = bp_get_friends_slug(); 99 $link = bp_displayed_user_url( 100 array( 101 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug, $activity_slug ), 102 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_' . $friends_slug, $friends_slug ), 103 ) 104 ); 92 $link = bp_displayed_user_url( bp_members_get_path_chunks( array( bp_get_activity_slug(), bp_get_friends_slug() ) ) ); 105 93 106 94 // Setup the feed. … … 138 126 139 127 // Get displayed user's group IDs. 140 $groups = groups_get_user_groups(); 141 $group_ids = implode( ',', $groups['groups'] ); 142 $activity_slug = bp_get_activity_slug(); 143 $groups_slug = bp_get_groups_slug(); 144 $link = bp_displayed_user_url( 145 array( 146 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug, $activity_slug ), 147 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_' . $groups_slug, $groups_slug ), 148 ) 149 ); 128 $groups = groups_get_user_groups(); 129 $group_ids = implode( ',', $groups['groups'] ); 130 $link = bp_displayed_user_url( bp_members_get_path_chunks( array( bp_get_activity_slug(), bp_get_groups_slug() ) ) ); 150 131 151 132 // Setup the feed. … … 190 171 } 191 172 192 $activity_slug = bp_get_activity_slug(); 193 $link = bp_displayed_user_url( 194 array( 195 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug, $activity_slug ), 196 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_mentions', 'mentions' ), 197 ) 198 ); 173 $link = bp_displayed_user_url( bp_members_get_path_chunks( array( bp_get_activity_slug(), 'mentions' ) ) ); 199 174 200 175 // Setup the feed. … … 234 209 235 210 // Get displayed user's favorite activity IDs. 236 $favs = bp_activity_get_user_favorites( bp_displayed_user_id() ); 237 $fav_ids = implode( ',', (array) $favs ); 238 $activity_slug = bp_get_activity_slug(); 239 $link = bp_displayed_user_url( 240 array( 241 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug, $activity_slug ), 242 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_favorites', 'favorites' ), 243 ) 244 ); 211 $favs = bp_activity_get_user_favorites( bp_displayed_user_id() ); 212 $fav_ids = implode( ',', (array) $favs ); 213 $link = bp_displayed_user_url( bp_members_get_path_chunks( array( bp_get_activity_slug(), 'favorites' ) ) ); 245 214 246 215 // Setup the feed. -
trunk/src/bp-activity/bp-activity-notifications.php
r13500 r13503 35 35 case 'new_at_mention': 36 36 $action_filter = 'at_mentions'; 37 $link = bp_loggedin_user_url( 38 array( 39 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug, $activity_slug ), 40 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_mentions', 'mentions' ), 41 ) 42 ); 37 $link = bp_loggedin_user_url( bp_members_get_path_chunks( array( $activity_slug, 'mentions' ) ) ); 43 38 44 39 /* translators: %s: the current user display name */ -
trunk/src/bp-activity/bp-activity-template.php
r13500 r13503 3892 3892 function bp_get_member_activity_feed_link() { 3893 3893 $activity_slug = bp_get_activity_slug(); 3894 $path_chunks = array( 3895 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug, $activity_slug ), 3896 ); 3894 $path_chunks = array( $activity_slug ); 3897 3895 3898 3896 // Single member activity feed link. 3899 3897 if ( bp_is_profile_component() || bp_is_current_action( 'just-me' ) ) { 3900 $path_chunks[ 'single_item_action'] = 'feed';3901 $link = bp_displayed_user_url( $path_chunks);3898 $path_chunks[] = 'feed'; 3899 $link = bp_displayed_user_url( bp_members_get_path_chunks( $path_chunks ) ); 3902 3900 3903 3901 // Friend feed link. 3904 3902 } elseif ( bp_is_active( 'friends' ) && bp_is_current_action( bp_get_friends_slug() ) ) { 3905 $friends_slug = bp_get_friends_slug(); 3906 $path_chunks['single_item_action'] = bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_' . $friends_slug, $friends_slug ); 3907 $path_chunks['single_item_action_variables'] = array( 'feed' ); 3908 $link = bp_displayed_user_url( $path_chunks ); 3903 $path_chunks[] = bp_get_friends_slug(); 3904 $path_chunks[] = array( 'feed' ); 3905 $link = bp_displayed_user_url( bp_members_get_path_chunks( $path_chunks ) ); 3909 3906 3910 3907 // Group feed link. 3911 3908 } elseif ( bp_is_active( 'groups' ) && bp_is_current_action( bp_get_groups_slug() ) ) { 3912 $groups_slug = bp_get_groups_slug(); 3913 $path_chunks['single_item_action'] = bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_' . $groups_slug, $groups_slug ); 3914 $path_chunks['single_item_action_variables'] = array( 'feed' ); 3915 $link = bp_displayed_user_url( $path_chunks ); 3909 $path_chunks[] = bp_get_groups_slug(); 3910 $path_chunks[] = array( 'feed' ); 3911 $link = bp_displayed_user_url( bp_members_get_path_chunks( $path_chunks ) ); 3916 3912 3917 3913 // Favorites activity feed link. 3918 3914 } elseif ( 'favorites' === bp_current_action() ) { 3919 $path_chunks[ 'single_item_action'] = bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_favorites', 'favorites' );3920 $path_chunks[ 'single_item_action_variables'] = array( 'feed' );3921 $link = bp_displayed_user_url( $path_chunks);3915 $path_chunks[] = 'favorites'; 3916 $path_chunks[] = array( 'feed' ); 3917 $link = bp_displayed_user_url( bp_members_get_path_chunks( $path_chunks ) ); 3922 3918 3923 3919 // Mentions activity feed link. 3924 3920 } elseif ( ( 'mentions' === bp_current_action() ) && bp_activity_do_mentions() ) { 3925 $path_chunks[ 'single_item_action'] = bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_mentions', 'mentions' );3926 $path_chunks[ 'single_item_action_variables'] = array( 'feed' );3927 $link = bp_displayed_user_url( $path_chunks);3921 $path_chunks[] = 'mentions'; 3922 $path_chunks[] = array( 'feed' ); 3923 $link = bp_displayed_user_url( bp_members_get_path_chunks( $path_chunks ) ); 3928 3924 3929 3925 // No feed link. -
trunk/src/bp-activity/classes/class-bp-activity-component.php
r13495 r13503 336 336 337 337 // Setup the logged in user variables. 338 $activity_slug = bp_get_activity_slug(); 339 $custom_activity_slug = bp_rewrites_get_slug( 'members', 'member_' . $activity_slug, $activity_slug ); 338 $activity_slug = bp_get_activity_slug(); 340 339 341 340 // Unread message count. 342 341 if ( bp_activity_do_mentions() ) { 343 342 $count = bp_get_total_mention_count_for_user( bp_loggedin_user_id() ); 344 if ( ! empty( $count ) ) {343 if ( ! empty( $count ) ) { 345 344 $title = sprintf( 346 345 /* translators: %s: Unread mention count for the current user */ … … 358 357 'id' => 'my-account-' . $this->id, 359 358 'title' => _x( 'Activity', 'My Account Activity sub nav', 'buddypress' ), 360 'href' => bp_loggedin_user_url( 361 array( 362 'single_item_component' => $custom_activity_slug, 363 ) 364 ), 359 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $activity_slug ) ) ), 365 360 ); 366 361 … … 370 365 'id' => 'my-account-' . $this->id . '-personal', 371 366 'title' => _x( 'Personal', 'My Account Activity sub nav', 'buddypress' ), 372 'href' => bp_loggedin_user_url( 373 array( 374 'single_item_component' => $custom_activity_slug, 375 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_just_me', 'just-me' ), 376 ) 377 ), 367 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $activity_slug, 'just-me' ) ) ), 378 368 'position' => 10, 379 369 ); … … 385 375 'id' => 'my-account-' . $this->id . '-mentions', 386 376 'title' => $title, 387 'href' => bp_loggedin_user_url( 388 array( 389 'single_item_component' => $custom_activity_slug, 390 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_mentions', 'mentions' ), 391 ) 392 ), 377 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $activity_slug, 'mentions' ) ) ), 393 378 'position' => 20, 394 379 ); … … 401 386 'id' => 'my-account-' . $this->id . '-favorites', 402 387 'title' => _x( 'Favorites', 'My Account Activity sub nav', 'buddypress' ), 403 'href' => bp_loggedin_user_url( 404 array( 405 'single_item_component' => $custom_activity_slug, 406 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_favorites', 'favorites' ), 407 ) 408 ), 388 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $activity_slug, 'favorites' ) ) ), 409 389 'position' => 30, 410 390 ); … … 413 393 // Friends? 414 394 if ( bp_is_active( 'friends' ) ) { 415 $friends_slug = bp_get_friends_slug();416 395 $wp_admin_nav[] = array( 417 396 'parent' => 'my-account-' . $this->id, 418 397 'id' => 'my-account-' . $this->id . '-friends', 419 398 'title' => _x( 'Friends', 'My Account Activity sub nav', 'buddypress' ), 420 'href' => bp_loggedin_user_url( 421 array( 422 'single_item_component' => $custom_activity_slug, 423 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_' . $friends_slug, $friends_slug ), 424 ) 425 ), 399 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $activity_slug, bp_get_friends_slug() ) ) ), 426 400 'position' => 40, 427 401 ); … … 430 404 // Groups? 431 405 if ( bp_is_active( 'groups' ) ) { 432 $groups_slug = bp_get_groups_slug();433 406 $wp_admin_nav[] = array( 434 407 'parent' => 'my-account-' . $this->id, 435 408 'id' => 'my-account-' . $this->id . '-groups', 436 409 'title' => _x( 'Groups', 'My Account Activity sub nav', 'buddypress' ), 437 'href' => bp_loggedin_user_url( 438 array( 439 'single_item_component' => $custom_activity_slug, 440 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_' . $groups_slug, $groups_slug ), 441 ) 442 ), 410 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $activity_slug, bp_get_groups_slug() ) ) ), 443 411 'position' => 50 444 412 ); -
trunk/src/bp-activity/screens/permalink.php
r13446 r13503 39 39 // Do not redirect at default. 40 40 $redirect = false; 41 $path_chunks = array( 42 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_activity', bp_get_activity_slug() ), 43 'single_item_action' => $activity->id, 44 ); 41 $path_chunks = bp_members_get_path_chunks( array( bp_get_activity_slug(), $activity->id ) ); 45 42 46 43 // Redirect based on the type of activity. -
trunk/src/bp-blogs/classes/class-bp-blogs-component.php
r13495 r13503 300 300 301 301 // Setup the logged in user variables. 302 $blogs_slug = bp_get_blogs_slug(); 303 $custom_blogs_slug = bp_rewrites_get_slug( 'members', 'member_' . $blogs_slug, $blogs_slug ); 302 $blogs_slug = bp_get_blogs_slug(); 304 303 305 304 // Add the "Sites" sub menu. … … 308 307 'id' => 'my-account-' . $this->id, 309 308 'title' => __( 'Sites', 'buddypress' ), 310 'href' => bp_loggedin_user_url( 311 array( 312 'single_item_component' => $custom_blogs_slug, 313 ) 314 ), 309 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $blogs_slug ) ) ), 315 310 ); 316 311 … … 320 315 'id' => 'my-account-' . $this->id . '-my-sites', 321 316 'title' => __( 'My Sites', 'buddypress' ), 322 'href' => bp_loggedin_user_url( 323 array( 324 'single_item_component' => $custom_blogs_slug, 325 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $blogs_slug . '_my_sites', 'my-sites' ), 326 ) 327 ), 317 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $blogs_slug, 'my-sites' ) ) ), 328 318 'position' => 10, 329 319 ); -
trunk/src/bp-core/bp-core-buddybar.php
r13500 r13503 755 755 // Try 'activity' first. 756 756 if ( bp_is_active( 'activity' ) && isset( $bp->pages->activity ) ) { 757 $activity_slug = bp_get_activity_slug(); 758 $redirect_to = bp_displayed_user_url( 759 array( 760 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug, $activity_slug ), 761 ) 762 ); 763 // Then try 'profile'. 757 $redirect_to = bp_displayed_user_url( bp_members_get_path_chunks( array( bp_get_activity_slug() ) ) ); 758 759 // Then try 'profile'. 764 760 } else { 765 $profile_slug = bp_get_profile_slug(); 766 $redirect_to = bp_displayed_user_url( 767 array( 768 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $profile_slug, $profile_slug ), 769 ) 770 ); 761 $redirect_to = bp_displayed_user_url( bp_members_get_path_chunks( array( bp_get_profile_slug() ) ) ); 771 762 } 772 763 -
trunk/src/bp-core/bp-core-filters.php
r13481 r13503 1252 1252 bp_members_get_user_url( 1253 1253 $user_obj->ID, 1254 array( 1255 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_settings', bp_get_settings_slug() ), 1256 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_settings_notifications', 'notifications' ), 1257 ) 1254 bp_members_get_path_chunks( array( bp_get_settings_slug(), 'notifications' ) ) 1258 1255 ) 1259 1256 ); -
trunk/src/bp-core/bp-core-functions.php
r13502 r13503 4362 4362 $redirect_to = bp_members_get_user_url( 4363 4363 get_current_user_id(), 4364 array( 4365 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_settings', bp_get_settings_slug() ), 4366 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_settings_notifications', 'notifications' ), 4367 ) 4364 bp_members_get_path_chunks( array( bp_get_settings_slug(), 'notifications' ) ) 4368 4365 ); 4369 4366 } else { … … 4394 4391 $redirect_to = bp_members_get_user_url( 4395 4392 $raw_user_id, 4396 array( 4397 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_settings', bp_get_settings_slug() ), 4398 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_settings_notifications', 'notifications' ), 4399 ) 4393 bp_members_get_path_chunks( array( bp_get_settings_slug(), 'notifications' ) ) 4400 4394 ); 4401 4395 } else { -
trunk/src/bp-core/deprecated/12.0.php
r13493 r13503 1424 1424 function bp_friend_search_form() { 1425 1425 _deprecated_function( __FUNCTION__, '12.0.0' ); 1426 $label = __( 'Filter Friends', 'buddypress' ); 1427 $friends_slug = bp_get_friends_slug(); 1428 $action = bp_displayed_user_url( 1429 array( 1430 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug, $friends_slug ), 1431 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_my_friends', 'my-friends' ), 1432 'single_item_action_variables' => array( bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_search', 'search' ) ), 1433 ) 1434 ); 1426 $label = __( 'Filter Friends', 'buddypress' ); 1427 $action = bp_displayed_user_url( bp_members_get_path_chunks( array( bp_get_friends_slug(), 'my-friends', array( 'search' ) ) ) ); 1435 1428 ?> 1436 1429 … … 1502 1495 function bp_group_search_form() { 1503 1496 _deprecated_function( __FUNCTION__, '12.0.0' ); 1504 $label = __('Filter Groups', 'buddypress'); 1505 $name = 'group-filter-box'; 1506 $groups_slug = bp_get_groups_slug(); 1507 $action = bp_displayed_user_url( 1508 array( 1509 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $groups_slug, $groups_slug ), 1510 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $groups_slug . '_my_groups', 'my-groups' ), 1511 'single_item_action_variables' => array( bp_rewrites_get_slug( 'members', 'member_' . $groups_slug . '_search', 'search' ) ), 1512 ) 1513 ); 1497 $label = __('Filter Groups', 'buddypress'); 1498 $name = 'group-filter-box'; 1499 $action = bp_displayed_user_url( bp_members_get_path_chunks( array( bp_get_groups_slug(), 'my-groups', array( 'search' ) ) ) ); 1514 1500 1515 1501 $search_form_html = '<form action="' . esc_url( $action ) . '" id="group-search-form" method="post"> -
trunk/src/bp-friends/bp-friends-blocks.php
r13488 r13503 113 113 $link = bp_members_get_user_url( 114 114 $user_id, 115 array( 116 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_friends', bp_get_friends_slug() ), 117 ) 115 bp_members_get_path_chunks( array( bp_get_friends_slug() ) ) 118 116 ); 119 117 -
trunk/src/bp-friends/bp-friends-functions.php
r13433 r13503 881 881 bp_members_get_user_url( 882 882 $friend_id, 883 array( 884 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_friends', bp_get_friends_slug() ), 885 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_friends_requests', 'requests' ), 886 ) 883 bp_members_get_path_chunks( array( bp_get_friends_slug(), 'requests' ) ) 887 884 ) 888 885 ), -
trunk/src/bp-friends/bp-friends-notifications.php
r13441 r13503 29 29 */ 30 30 function friends_format_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) { 31 $friends_slug = bp_get_friends_slug(); 32 $custom_friends_slug = bp_rewrites_get_slug( 'members', 'member_' . $friends_slug, $friends_slug ); 31 $friends_slug = bp_get_friends_slug(); 33 32 34 33 switch ( $action ) { 35 34 case 'friendship_accepted': 36 $link = bp_loggedin_user_url( 37 array( 38 'single_item_component' => $custom_friends_slug, 39 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_my_friends', 'my-friends' ), 40 ) 41 ); 35 $link = bp_loggedin_user_url( bp_members_get_path_chunks( array( $friends_slug, 'my-friends' ) ) ); 42 36 43 37 // $action and $amount are used to generate dynamic filter names. … … 61 55 'new', 62 56 1, 63 bp_loggedin_user_url( 64 array( 65 'single_item_component' => $custom_friends_slug, 66 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_requests', 'requests' ), 67 ) 68 ) 57 bp_loggedin_user_url( bp_members_get_path_chunks( array( $friends_slug, 'requests' ) ) ) 69 58 ); 70 59 -
trunk/src/bp-friends/bp-friends-template.php
r13493 r13503 222 222 223 223 $friendship_status = bp_is_friend( $potential_friend_id ); 224 $friends_slug = bp_get_friends_slug(); 225 $custom_friends_slug = bp_rewrites_get_slug( 'members', 'member_' . $friends_slug, $friends_slug ); 224 $friends_slug = bp_get_friends_slug(); 226 225 227 226 if ( empty( $friendship_status ) ) { … … 239 238 'wrapper_id' => 'friendship-button-' . $potential_friend_id, 240 239 'link_href' => wp_nonce_url( 241 bp_loggedin_user_url( 242 array( 243 'single_item_component' => $custom_friends_slug, 244 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_requests', 'requests' ), 245 'single_item_action_variables' => array( bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_requests_cancel', 'cancel' ), $potential_friend_id ), 246 ) 247 ), 240 bp_loggedin_user_url( bp_members_get_path_chunks( array( $friends_slug, 'requests', array( 'cancel', $potential_friend_id ) ) ) ), 248 241 'friends_withdraw_friendship' 249 242 ), … … 264 257 'wrapper_class' => 'friendship-button awaiting_response_friend', 265 258 'wrapper_id' => 'friendship-button-' . $potential_friend_id, 266 'link_href' => bp_loggedin_user_url( 267 array( 268 'single_item_component' => $custom_friends_slug, 269 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_requests', 'requests' ), 270 ) 271 ), 259 'link_href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $friends_slug, 'requests' ) ) ), 272 260 'link_text' => __( 'Friendship Requested', 'buddypress' ), 273 261 'link_title' => __( 'Friendship Requested', 'buddypress' ), … … 287 275 'wrapper_id' => 'friendship-button-' . $potential_friend_id, 288 276 'link_href' => wp_nonce_url( 289 bp_loggedin_user_url( 290 array( 291 'single_item_component' => $custom_friends_slug, 292 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_remove_friend', 'remove-friend' ), 293 'single_item_action_variables' => array( $potential_friend_id ), 294 ) 295 ), 277 bp_loggedin_user_url( bp_members_get_path_chunks( array( $friends_slug, 'remove-friend', array( $potential_friend_id ) ) ) ), 296 278 'friends_remove_friend' 297 279 ), … … 313 295 'wrapper_id' => 'friendship-button-' . $potential_friend_id, 314 296 'link_href' => wp_nonce_url( 315 bp_loggedin_user_url( 316 array( 317 'single_item_component' => $custom_friends_slug, 318 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_add_friend', 'add-friend' ), 319 'single_item_action_variables' => array( $potential_friend_id ), 320 ) 321 ), 297 bp_loggedin_user_url( bp_members_get_path_chunks( array( $friends_slug, 'add-friend', array( $potential_friend_id ) ) ) ), 322 298 'friends_add_friend' 323 299 ), … … 488 464 } 489 465 490 $friends_slug = bp_get_friends_slug(); 491 $url = wp_nonce_url( 492 bp_loggedin_user_url( 493 array( 494 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug, $friends_slug ), 495 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_requests', 'requests' ), 496 'single_item_action_variables' => array( bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_requests_accept', 'accept' ), $friendship_id ), 497 ) 498 ), 466 $url = wp_nonce_url( 467 bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_get_friends_slug(), 'requests', array( 'accept', $friendship_id ) ) ) ), 499 468 'friends_accept_friendship' 500 469 ); … … 537 506 } 538 507 539 $friends_slug = bp_get_friends_slug(); 540 $url = wp_nonce_url( 541 bp_loggedin_user_url( 542 array( 543 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug, $friends_slug ), 544 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_requests', 'requests' ), 545 'single_item_action_variables' => array( bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_requests_reject', 'reject' ), $friendship_id ), 546 ) 547 ), 508 $url = wp_nonce_url( 509 bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_get_friends_slug(), 'requests', array( 'reject', $friendship_id ) ) ) ), 548 510 'friends_reject_friendship' 549 511 ); -
trunk/src/bp-friends/classes/class-bp-friends-component.php
r13495 r13503 242 242 243 243 // Setup the logged in user variables. 244 $friends_slug = bp_get_friends_slug(); 245 $custom_friends_slug = bp_rewrites_get_slug( 'members', 'member_' . $friends_slug, $friends_slug ); 244 $friends_slug = bp_get_friends_slug(); 246 245 247 246 // Pending friend requests. … … 268 267 'id' => 'my-account-' . $this->id, 269 268 'title' => $title, 270 'href' => bp_loggedin_user_url( 271 array( 272 'single_item_component' => $custom_friends_slug, 273 ) 274 ), 269 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $friends_slug ) ) ), 275 270 ); 276 271 … … 280 275 'id' => 'my-account-' . $this->id . '-friendships', 281 276 'title' => _x( 'Friendships', 'My Account Friends menu sub nav', 'buddypress' ), 282 'href' => bp_loggedin_user_url( 283 array( 284 'single_item_component' => $custom_friends_slug, 285 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_my_friends', 'my-friends' ), 286 ) 287 ), 277 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $friends_slug, 'my-friends' ) ) ), 288 278 'position' => 10, 289 279 ); … … 294 284 'id' => 'my-account-' . $this->id . '-requests', 295 285 'title' => $pending, 296 'href' => bp_loggedin_user_url( 297 array( 298 'single_item_component' => $custom_friends_slug, 299 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_requests', 'requests' ), 300 ) 301 ), 286 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $friends_slug, 'requests' ) ) ), 302 287 'position' => 20, 303 288 ); -
trunk/src/bp-friends/screens/requests.php
r13441 r13503 54 54 55 55 if ( $redirect ) { 56 $friends_slug = bp_get_friends_slug();57 58 56 bp_core_redirect( 59 57 bp_loggedin_user_url( 60 array( 61 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug, $friends_slug ), 62 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_requests', 'requests' ), 63 ) 58 bp_members_get_path_chunks( array( bp_get_friends_slug(), 'requests' ) ) 64 59 ) 65 60 ); -
trunk/src/bp-groups/actions/leave-group.php
r13441 r13503 50 50 51 51 if ( ! $group->is_visible ) { 52 $groups_slug = bp_get_groups_slug(); 53 $redirect = bp_loggedin_user_url( 54 array( 55 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $groups_slug, $groups_slug ), 56 ) 57 ); 52 $redirect = bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_get_groups_slug() ) ) ); 58 53 } 59 54 -
trunk/src/bp-groups/bp-groups-adminbar.php
r13441 r13503 83 83 'id' => $menu->slug, 84 84 'title' => $title, 85 'href' => bp_get_group_ url(85 'href' => bp_get_group_manage_url( 86 86 $bp->groups->current_group, 87 array( 88 'single_item_action' => bp_rewrites_get_slug( 'groups', 'bp_group_read_admin', 'admin' ), 89 'single_item_action_variables' => bp_rewrites_get_slug( 'groups', $manage_screens[ $menu->slug ]['rewrite_id'], $menu->slug ), 90 ) 87 bp_groups_get_path_chunks( array( $menu->slug ), 'manage' ) 91 88 ), 92 89 ) -
trunk/src/bp-groups/bp-groups-notifications.php
r13446 r13503 340 340 $invited_link = bp_members_get_user_url( 341 341 $invited_user_id, 342 array( 343 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_groups', bp_get_groups_slug() ), 344 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_groups_invites', 'invites' ), 345 ) 342 bp_members_get_path_chunks( array( bp_get_groups_slug(), 'invites' ) ) 346 343 ); 347 344 … … 418 415 'n' => 1, 419 416 ), 420 bp_get_group_ url(417 bp_get_group_manage_url( 421 418 $group, 422 array( 423 'single_item_action' => bp_rewrites_get_slug( 'groups', 'bp_group_read_admin', 'admin' ), 424 'single_item_action_variables' => array( bp_rewrites_get_slug( 'groups', 'bp_group_manage_membership_requests', 'membership-requests' ) ), 425 ) 419 bp_groups_get_path_chunks( array( 'membership-requests' ), 'manage' ) 426 420 ) 427 421 ); … … 476 470 'n' => 1, 477 471 ), 478 bp_get_group_ url(472 bp_get_group_manage_url( 479 473 $group, 480 array( 481 'single_item_action' => bp_rewrites_get_slug( 'groups', 'bp_group_read_admin', 'admin' ), 482 'single_item_action_variables' => array( bp_rewrites_get_slug( 'groups', 'bp_group_manage_membership_requests', 'membership-requests' ) ), 483 ) 474 bp_groups_get_path_chunks( array( 'membership-requests' ), 'manage' ) 484 475 ) 485 476 ); … … 532 523 $group_id = $item_id; 533 524 534 $group = groups_get_group( $group_id ); 535 $group_link = bp_get_group_url( $group ); 536 $groups_slug = bp_get_groups_slug(); 537 $custom_groups_slug = bp_rewrites_get_slug( 'members', 'member_' . $groups_slug, $groups_slug ); 538 $amount = 'single'; 525 $group = groups_get_group( $group_id ); 526 $group_link = bp_get_group_url( $group ); 527 $amount = 'single'; 539 528 540 529 if ( (int) $total_items > 1 ) { … … 545 534 'n', 546 535 1, 547 bp_loggedin_user_url( 548 array( 549 'single_item_component' => $custom_groups_slug, 550 ) 551 ) 536 bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_get_groups_slug() ) ) ) 552 537 ); 553 538 … … 633 618 $group_id = $item_id; 634 619 635 $group = groups_get_group( $group_id ); 636 $group_link = bp_get_group_url( $group ); 637 $groups_slug = bp_get_groups_slug(); 638 $custom_groups_slug = bp_rewrites_get_slug( 'members', 'member_' . $groups_slug, $groups_slug ); 639 $amount = 'single'; 620 $group = groups_get_group( $group_id ); 621 $group_link = bp_get_group_url( $group ); 622 $amount = 'single'; 640 623 641 624 if ( (int) $total_items > 1 ) { … … 646 629 'n', 647 630 1, 648 bp_loggedin_user_url( 649 array( 650 'single_item_component' => $custom_groups_slug, 651 ) 652 ) 631 bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_get_groups_slug() ) ) ) 653 632 ); 654 633 … … 733 712 $group_id = $item_id; 734 713 735 $group = groups_get_group( $group_id ); 736 $group_link = bp_get_group_url( $group ); 737 $groups_slug = bp_get_groups_slug(); 738 $custom_groups_slug = bp_rewrites_get_slug( 'members', 'member_' . $groups_slug, $groups_slug ); 739 $amount = 'single'; 714 $group = groups_get_group( $group_id ); 715 $group_link = bp_get_group_url( $group ); 716 $amount = 'single'; 740 717 741 718 if ( (int) $total_items > 1 ) { … … 746 723 'n', 747 724 1, 748 bp_loggedin_user_url( 749 array( 750 'single_item_component' => $custom_groups_slug, 751 ) 752 ) 725 bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_get_groups_slug() ) ) ) 753 726 ); 754 727 … … 827 800 $group_id = $item_id; 828 801 829 $group = groups_get_group( $group_id ); 830 $group_link = bp_get_group_url( $group ); 831 $groups_slug = bp_get_groups_slug(); 832 $custom_groups_slug = bp_rewrites_get_slug( 'members', 'member_' . $groups_slug, $groups_slug ); 833 $amount = 'single'; 802 $group = groups_get_group( $group_id ); 803 $group_link = bp_get_group_url( $group ); 804 $amount = 'single'; 834 805 835 806 if ( (int) $total_items > 1 ) { … … 840 811 'n', 841 812 1, 842 bp_loggedin_user_url( 843 array( 844 'single_item_component' => $custom_groups_slug, 845 ) 846 ) 813 bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_get_groups_slug() ) ) ) 847 814 ); 848 815 … … 922 889 $group = groups_get_group( $group_id ); 923 890 $group_link = bp_get_group_url( $group ); 924 $groups_slug = bp_get_groups_slug();925 $custom_groups_slug = bp_rewrites_get_slug( 'members', 'member_' . $groups_slug, $groups_slug );926 891 $amount = 'single'; 927 892 $notification_link = add_query_arg( 928 893 'n', 929 894 1, 930 bp_loggedin_user_url( 931 array( 932 'single_item_component' => $custom_groups_slug, 933 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $groups_slug . '_invites', 'invites' ), 934 ) 935 ) 895 bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_get_groups_slug(), 'invites' ) ) ) 936 896 ); 937 897 … … 1337 1297 bp_members_get_user_url( 1338 1298 $user_id, 1339 array( 1340 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_groups', bp_get_groups_slug() ), 1341 ) 1299 bp_members_get_path_chunks( array( bp_get_groups_slug() ) ) 1342 1300 ) 1343 1301 ), -
trunk/src/bp-groups/bp-groups-template.php
r13496 r13503 2945 2945 function bp_get_group_form_action( $page, $group = false ) { 2946 2946 $group = bp_get_group( $group ); 2947 $url = ''; 2947 2948 2948 2949 if ( empty( $group->id ) || empty( $page ) ) { 2949 return '';2950 return $url; 2950 2951 } 2951 2952 2952 2953 $screens = bp_get_group_screens( 'read' ); 2953 2954 if ( isset( $screens[ $page ]['rewrite_id'] ) ) { 2954 $page = bp_rewrites_get_slug( 'groups', $screens[ $page ]['rewrite_id'], $page ); 2955 } 2956 2957 $url = bp_get_group_url( 2958 $group, 2959 array( 2960 'single_item_action' => $page, 2961 ) 2962 ); 2955 $url = bp_get_group_url( 2956 $group, 2957 bp_groups_get_path_chunks( array( $page ) ) 2958 ); 2959 } 2963 2960 2964 2961 /** … … 3001 2998 function bp_get_group_admin_form_action( $page = false, $group = false ) { 3002 2999 $group = bp_get_group( $group ); 3000 $url = ''; 3003 3001 3004 3002 if ( empty( $group->id ) ) { 3005 return '';3003 return $url; 3006 3004 } 3007 3005 … … 3012 3010 $screens = bp_get_group_screens( 'manage' ); 3013 3011 if ( isset( $screens[ $page ]['rewrite_id'] ) ) { 3014 $page = bp_rewrites_get_slug( 'groups', $screens[ $page ]['rewrite_id'], $page ); 3015 } 3016 3017 $url = bp_get_group_url( 3018 $group, 3019 array( 3020 'single_item_action' => bp_rewrites_get_slug( 'groups', 'bp_group_read_admin', 'admin' ), 3021 'single_item_action_variables' => $page, 3022 ) 3023 ); 3012 $url = bp_get_group_manage_url( 3013 $group, 3014 bp_groups_get_path_chunks( array( $page ), 'manage' ) 3015 ); 3016 } 3024 3017 3025 3018 /** … … 3212 3205 } 3213 3206 3214 $groups_slug = bp_get_groups_slug(); 3215 $path_chunks = array( 3216 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $groups_slug, $groups_slug ), 3217 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $groups_slug . '_invites', 'invites' ), 3218 'single_item_action_variables' => array( bp_rewrites_get_slug( 'members', 'member_' . $groups_slug . '_invites_accept', 'accept' ), $group->id ), 3219 ); 3207 $path_chunks = bp_members_get_path_chunks( array( bp_get_groups_slug(), 'invites', array( 'accept', $group->id ) ) ); 3220 3208 3221 3209 if ( bp_is_user() ) { … … 3265 3253 } 3266 3254 3267 $groups_slug = bp_get_groups_slug(); 3268 $path_chunks = array( 3269 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $groups_slug, $groups_slug ), 3270 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $groups_slug . '_invites', 'invites' ), 3271 'single_item_action_variables' => array( bp_rewrites_get_slug( 'members', 'member_' . $groups_slug . '_invites_reject', 'reject' ), $group->id ), 3272 ); 3255 $path_chunks = bp_members_get_path_chunks( array( bp_get_groups_slug(), 'invites', array( 'reject', $group->id ) ) ); 3273 3256 3274 3257 if ( bp_is_user() ) { -
trunk/src/bp-groups/classes/class-bp-groups-component.php
r13492 r13503 765 765 if ( bp_is_item_admin() ) { 766 766 // Get the "manage" screens. 767 $manage_screens = bp_get_group_screens( 'manage', true ); 768 $admin_link = bp_get_group_url( 769 $this->current_group, 770 array( 771 'single_item_action' => bp_rewrites_get_slug( 'groups', 'bp_group_read_admin', 'admin' ), 772 ) 773 ); 767 $manage_screens = bp_get_group_screens( 'manage', true ); 774 768 775 769 // Common params to all nav items. … … 840 834 841 835 // Setup the logged in user variables. 842 $groups_slug = bp_get_groups_slug(); 843 $custom_groups_slug = bp_rewrites_get_slug( 'members', 'member_' . $groups_slug, $groups_slug ); 836 $groups_slug = bp_get_groups_slug(); 844 837 845 838 $title = _x( 'Groups', 'My Account Groups', 'buddypress' ); … … 869 862 'id' => 'my-account-' . $this->id, 870 863 'title' => $title, 871 'href' => bp_loggedin_user_url( 872 array( 873 'single_item_component' => $custom_groups_slug, 874 ) 875 ), 864 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $groups_slug ) ) ), 876 865 ); 877 866 … … 881 870 'id' => 'my-account-' . $this->id . '-memberships', 882 871 'title' => _x( 'Memberships', 'My Account Groups sub nav', 'buddypress' ), 883 'href' => bp_loggedin_user_url( 884 array( 885 'single_item_component' => $custom_groups_slug, 886 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $groups_slug . '_my_groups', 'my-groups' ), 887 ) 888 ), 872 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $groups_slug, 'my-groups' ) ) ), 889 873 'position' => 10, 890 874 ); … … 896 880 'id' => 'my-account-' . $this->id . '-invites', 897 881 'title' => $pending, 898 'href' => bp_loggedin_user_url( 899 array( 900 'single_item_component' => $custom_groups_slug, 901 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $groups_slug . '_invites', 'invites' ), 902 ) 903 ), 882 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $groups_slug, 'invites' ) ) ), 904 883 'position' => 30, 905 884 ); -
trunk/src/bp-groups/screens/single/admin/delete-group.php
r13441 r13503 19 19 } 20 20 21 if ( ! bp_is_item_admin() && ! bp_current_user_can( 'bp_moderate' ) ) {21 if ( ! bp_is_item_admin() && ! bp_current_user_can( 'bp_moderate' ) ) { 22 22 return false; 23 23 } … … 27 27 if ( isset( $_REQUEST['delete-group-button'] ) && isset( $_REQUEST['delete-group-understand'] ) ) { 28 28 $groups_slug = bp_get_groups_slug(); 29 $redirect = bp_loggedin_user_url( 30 array( 31 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $groups_slug, $groups_slug ), 32 ) 33 ); 29 $redirect = bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_get_groups_slug() ) ) ); 34 30 35 31 // Check the nonce first. -
trunk/src/bp-members/actions/invitations-bulk-manage.php
r13443 r13503 77 77 } 78 78 79 $invite_slug = bp_get_members_invitations_slug(); 80 $action_slug = bp_current_action(); 81 $action_rewrite_id = str_replace( '-', '_', $action_slug ); 82 83 $path_chunks = array( 84 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $invite_slug, $invite_slug ), 85 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $invite_slug . '_' . $action_rewrite_id, $action_slug ), 86 ); 79 $invite_slug = bp_get_members_invitations_slug(); 80 $action_slug = bp_current_action(); 81 $path_chunks = bp_members_get_path_chunks( array( $invite_slug, $action_slug ) ); 87 82 88 83 // Redirect. -
trunk/src/bp-members/bp-members-adminbar.php
r13493 r13503 211 211 212 212 if ( bp_current_user_can( 'bp_members_invitations_view_screens' ) ) { 213 $bp = buddypress(); 214 $invite_slug = bp_get_members_invitations_slug(); 215 $custom_invite_slug = bp_rewrites_get_slug( 'members', 'member_' . $invite_slug, $invite_slug ); 213 $bp = buddypress(); 214 $invite_slug = bp_get_members_invitations_slug(); 216 215 217 216 $wp_admin_bar->add_node( … … 220 219 'parent' => $bp->my_account_menu_id, 221 220 'title' => __( 'Invitations', 'buddypress' ), 222 'href' => bp_loggedin_user_url( 223 array( 224 'single_item_component' => $custom_invite_slug, 225 ) 226 ), 221 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $invite_slug ) ) ), 227 222 'meta' => array( 228 223 'class' => 'ab-sub-secondary' … … 237 232 'parent' => $bp->my_account_menu_id . '-invitations', 238 233 'title' => __( 'Send Invites', 'buddypress' ), 239 'href' => bp_loggedin_user_url( 240 array( 241 'single_item_component' => $custom_invite_slug, 242 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $invite_slug . '_send_invites', 'send-invites' ), 243 ) 244 ), 234 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $invite_slug, 'send-invites' ) ) ), 245 235 'meta' => array( 246 236 'class' => 'ab-sub-secondary' … … 255 245 'parent' => $bp->my_account_menu_id . '-invitations', 256 246 'title' => __( 'Pending Invites', 'buddypress' ), 257 'href' => bp_loggedin_user_url( 258 array( 259 'single_item_component' => $custom_invite_slug, 260 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $invite_slug . '_list_invites', 'list-invites' ), 261 ) 262 ), 247 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $invite_slug, 'list-invites' ) ) ), 263 248 'meta' => array( 264 249 'class' => 'ab-sub-secondary' -
trunk/src/bp-members/bp-members-filters.php
r13436 r13503 111 111 $profile_link = bp_members_get_user_url( 112 112 $user_id, 113 array( 114 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_profile', bp_get_profile_slug() ), 115 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_profile_edit', 'edit' ), 116 ) 113 bp_members_get_path_chunks( array( bp_get_profile_slug(), 'edit' ) ) 117 114 ); 118 115 -
trunk/src/bp-members/bp-members-template.php
r13443 r13503 3094 3094 } 3095 3095 3096 $path_chunks = array( 3097 'single_item_component' => $bp->{$component}->slug, 3098 ); 3099 3100 // Append $action to $url if there is no $type. 3096 $path_chunks = array( $bp->{$component}->slug ); 3097 3098 // Append $action to $url if needed. 3101 3099 if ( ! empty( $action ) ) { 3102 $action_rewrite_id = 'member_' . str_replace( '-', '_', $action ); 3103 $path_chunks['single_item_action'] = bp_rewrites_get_slug( 'members', $action_rewrite_id, $action ); 3104 } 3105 3106 // Add a slash at the end of our user url. 3100 $path_chunks[] = $action; 3101 } 3102 3103 // Check for slugs customization. 3104 $path_chunks = bp_members_get_path_chunks( $path_chunks ); 3105 3106 // Generate user url. 3107 3107 $url = bp_displayed_user_url( $path_chunks ); 3108 3108 … … 3147 3147 $url = wp_nonce_url( 3148 3148 bp_displayed_user_url( 3149 array( 3150 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $profile_slug, $profile_slug ), 3151 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $profile_slug . '_change_avatar', 'change-avatar' ), 3152 'single_item_action_variables' => array( bp_rewrites_get_slug( 'members', 'member_' . $profile_slug . '_delete_avatar', 'delete-avatar' ) ), 3153 ) 3149 bp_members_get_path_chunks( array( $profile_slug, 'change-avatar', array( 'delete-avatar' ) ) ) 3154 3150 ), 3155 3151 'bp_delete_avatar_link' … … 3679 3675 $retval = bp_members_get_user_url( 3680 3676 (int) $user_id, 3681 array( 3682 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_invitations', bp_get_members_invitations_slug() ), 3683 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_invitations_list_invites', 'list-invites' ), 3684 ) 3677 bp_members_get_path_chunks( array( bp_get_members_invitations_slug(), 'list-invites' ) ) 3685 3678 ); 3686 3679 … … 3721 3714 $retval = bp_members_get_user_url( 3722 3715 (int) $user_id, 3723 array( 3724 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_invitations', bp_get_members_invitations_slug() ), 3725 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_invitations_send_invites', 'send-invites' ), 3726 ) 3716 bp_members_get_path_chunks( array( bp_get_members_invitations_slug(), 'send-invites' ) ) 3727 3717 ); 3728 3718 -
trunk/src/bp-members/classes/class-bp-members-component.php
r13499 r13503 534 534 */ 535 535 public function get_avatar_cover_image_admin_navs( $admin_bar_menu_id = '' ) { 536 $wp_admin_nav = array(); 537 $profile_slug = bp_get_profile_slug(); 538 $custom_profile_slug = bp_rewrites_get_slug( 'members', 'member_' . $profile_slug, $profile_slug ); 536 $wp_admin_nav = array(); 537 $profile_slug = bp_get_profile_slug(); 539 538 540 539 if ( ! $admin_bar_menu_id ) { … … 548 547 'id' => 'my-account-' . $admin_bar_menu_id . '-change-avatar', 549 548 'title' => _x( 'Change Profile Photo', 'My Account Profile sub nav', 'buddypress' ), 550 'href' => bp_loggedin_user_url( 551 array( 552 'single_item_component' => $custom_profile_slug, 553 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $profile_slug . '_change_avatar', 'change-avatar' ), 554 ) 555 ), 549 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $profile_slug, 'change-avatar' ) ) ), 556 550 'position' => 30, 557 551 ); … … 564 558 'id' => 'my-account-' . $admin_bar_menu_id . '-change-cover-image', 565 559 'title' => _x( 'Change Cover Image', 'My Account Profile sub nav', 'buddypress' ), 566 'href' => bp_loggedin_user_url( 567 array( 568 'single_item_component' => $custom_profile_slug, 569 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $profile_slug . '_change_cover_image', 'change-cover-image' ), 570 ) 571 ), 560 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $profile_slug, 'change-cover-image' ) ) ), 572 561 'position' => 40, 573 562 ); … … 587 576 // Menus for logged in user. 588 577 if ( is_user_logged_in() ) { 589 $profile_slug = bp_get_profile_slug(); 590 $custom_profile_slug = bp_rewrites_get_slug( 'members', 'member_' . $profile_slug, $profile_slug ); 578 $profile_slug = bp_get_profile_slug(); 591 579 592 580 if ( ! bp_is_active( 'xprofile' ) ) { … … 596 584 'id' => 'my-account-' . $this->id, 597 585 'title' => _x( 'Profile', 'My Account Profile', 'buddypress' ), 598 'href' => bp_loggedin_user_url( 599 array( 600 'single_item_component' => $custom_profile_slug, 601 ) 602 ), 586 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $profile_slug ) ) ), 603 587 ); 604 588 … … 608 592 'id' => 'my-account-' . $this->id . '-public', 609 593 'title' => _x( 'View', 'My Account Profile sub nav', 'buddypress' ), 610 'href' => bp_loggedin_user_url( 611 array( 612 'single_item_component' => $custom_profile_slug, 613 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $profile_slug . '_public', 'public' ), 614 ) 615 ), 594 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $profile_slug, 'public' ) ) ), 616 595 'position' => 10, 617 596 ); -
trunk/src/bp-messages/actions/compose.php
r13442 r13503 44 44 45 45 // Setup the link to the logged-in user's messages. 46 $message_slug = bp_get_messages_slug(); 47 $custom_message_slug = bp_rewrites_get_slug( 'members', 'member_' . $message_slug, $message_slug ); 48 $path_chunks = array( 49 'single_item_component' => $custom_message_slug, 50 ); 46 $path_chunks = array( bp_get_messages_slug() ); 51 47 52 48 // Site-wide notice. … … 55 51 // Attempt to save the notice and redirect to notices. 56 52 if ( messages_send_notice( $_POST['subject'], $_POST['content'] ) ) { 57 $success 58 $feedback 59 $path_chunks[ 'single_item_action'] = bp_rewrites_get_slug( 'members', 'member_' . $message_slug . '_notices', 'notices' );60 $redirect_to = bp_loggedin_user_url( $path_chunks);53 $success = true; 54 $feedback = __( 'Notice successfully created.', 'buddypress' ); 55 $path_chunks[] = 'notices'; 56 $redirect_to = bp_loggedin_user_url( bp_members_get_path_chunks( $path_chunks ) ); 61 57 62 58 // Notice could not be sent. … … 93 89 // Send the message and redirect to it. 94 90 if ( true === is_int( $send ) ) { 95 $success 96 $feedback 97 $path_chunks[ 'single_item_action'] = bp_rewrites_get_slug( 'members', 'member_' . $message_slug . '_view', 'view' );98 $path_chunks[ 'single_item_action_variables'] = array( $send );99 $redirect_to = bp_loggedin_user_url( $path_chunks);91 $success = true; 92 $feedback = __( 'Message successfully sent.', 'buddypress' ); 93 $path_chunks[] = 'view'; 94 $path_chunks[] = array( $send ); 95 $redirect_to = bp_loggedin_user_url( bp_members_get_path_chunks( $path_chunks ) ); 100 96 101 97 // Message could not be sent. -
trunk/src/bp-messages/actions/notices.php
r13442 r13503 87 87 88 88 // Redirect. 89 $message_slug = bp_get_messages_slug(); 90 $custom_message_slug = bp_rewrites_get_slug( 'members', 'member_' . $message_slug, $message_slug ); 91 $redirect_to = bp_loggedin_user_url( 92 array( 93 'single_item_component' => $custom_message_slug, 94 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $message_slug . '_notices', 'notices' ), 95 ) 96 ); 89 $redirect_to = bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_get_messages_slug(), 'notices' ) ) ); 97 90 98 91 bp_core_redirect( $redirect_to ); … … 138 131 139 132 // Redirect. 140 $message_slug = bp_get_messages_slug(); 141 $custom_message_slug = bp_rewrites_get_slug( 'members', 'member_' . $message_slug, $message_slug ); 142 $redirect_to = bp_loggedin_user_url( 143 array( 144 'single_item_component' => $custom_message_slug, 145 ) 146 ); 133 $redirect_to = bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_get_messages_slug() ) ) ); 147 134 148 135 bp_core_redirect( $redirect_to ); -
trunk/src/bp-messages/actions/star.php
r13443 r13503 42 42 43 43 if ( ! $redirect ) { 44 $messages_slug = bp_get_messages_slug(); 45 $redirect = bp_displayed_user_url( 46 array( 47 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $messages_slug, $messages_slug ), 48 ) 49 ); 44 $redirect = bp_displayed_user_url( bp_members_get_path_chunks( array( bp_get_messages_slug() ) ) ); 50 45 } 51 46 -
trunk/src/bp-messages/bp-messages-functions.php
r13433 r13503 630 630 bp_members_get_user_url( 631 631 $recipient->user_id, 632 array( 633 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_messages', bp_get_messages_slug() ), 634 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_messages_view', 'view' ), 635 'single_item_action_variables' => array( $thread_id ), 636 ) 632 bp_members_get_path_chunks( array( bp_get_messages_slug(), 'view', array( $thread_id ) ) ) 637 633 ) 638 634 ), -
trunk/src/bp-messages/bp-messages-notifications.php
r13442 r13503 25 25 */ 26 26 function messages_format_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) { 27 $total_items = (int) $total_items; 28 $text = ''; 29 $message_slug = bp_get_messages_slug(); 30 $custom_message_slug = bp_rewrites_get_slug( 'members', 'member_' . $message_slug, $message_slug ); 31 $link = bp_loggedin_user_url( 32 array( 33 'single_item_component' => $custom_message_slug, 34 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $message_slug . '_inbox', 'inbox' ), 35 ) 36 ); 37 $title = __( 'Inbox', 'buddypress' ); 38 $amount = 'single'; 27 $total_items = (int) $total_items; 28 $text = ''; 29 $link = bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_get_messages_slug(), 'inbox' ) ) ); 30 $title = __( 'Inbox', 'buddypress' ); 31 $amount = 'single'; 39 32 40 33 if ( 'new_message' === $action ) { -
trunk/src/bp-messages/bp-messages-star.php
r13442 r13503 114 114 ); 115 115 116 // Check user ID and determine base user slug. 117 $user_slug = bp_members_get_user_slug( $r['user_id'] ); 118 119 // Bail if no user domain was calculated. 120 if ( empty( $user_slug ) ) { 116 // Check user ID. 117 $user_id = (int) $r['user_id']; 118 if ( empty( $user_id ) ) { 121 119 return ''; 122 120 } 123 121 124 $message_slug = bp_get_messages_slug(); 125 $custom_message_slug = bp_rewrites_get_slug( 'members', 'member_' . $message_slug, $message_slug ); 126 $path_chunks = array( 127 'component_id' => 'members', 128 'single_item' => $user_slug, 129 'single_item_component' => $custom_message_slug, 130 ); 122 // Init path chunks. 123 $path_chunks = array( bp_get_messages_slug() ); 131 124 132 125 // Define local variables. … … 175 168 176 169 if ( true === $is_starred ) { 177 $action 178 $bulk_attr 179 $path_chunks[ 'single_item_action'] = bp_rewrites_get_slug( 'members', 'member_' . $message_slug . '_unstar', 'unstar' );180 $path_chunks[ 'single_item_action_variables'] = array( $message_id, $nonce, bp_rewrites_get_slug( 'members', 'member_' . $message_slug . '_all', 'all' ));170 $action = 'unstar'; 171 $bulk_attr = ' data-star-bulk="1"'; 172 $path_chunks[] = $action; 173 $path_chunks[] = array( $message_id, $nonce, 'all' ); 181 174 } else { 182 $action 183 $path_chunks[ 'single_item_action'] = bp_rewrites_get_slug( 'members', 'member_' . $message_slug . '_star', 'star' );184 $path_chunks[ 'single_item_action_variables'] = array( $message_id, $nonce );175 $action = 'star'; 176 $path_chunks[] = $action; 177 $path_chunks[] = array( $message_id, $nonce ); 185 178 } 186 179 … … 194 187 195 188 if ( true === $is_starred ) { 196 $action = 'unstar'; 197 $path_chunks['single_item_action'] = bp_rewrites_get_slug( 'members', 'member_' . $message_slug . '_unstar', 'unstar' ); 198 $path_chunks['single_item_action_variables'] = array( $message_id, $nonce ); 189 $action = 'unstar'; 199 190 } else { 200 $action 201 $path_chunks['single_item_action'] = bp_rewrites_get_slug( 'members', 'member_' . $message_slug . '_star', 'star' );202 $path_chunks['single_item_action_variables'] = array( $message_id, $nonce ); 203 }204 205 $title = $r["title_{$action}"];206 } 207 208 $url = bp_ rewrites_get_url( $path_chunks);191 $action = 'star'; 192 } 193 194 $path_chunks[] = $action; 195 $path_chunks[] = array( $message_id, $nonce ); 196 $title = $r["title_{$action}"]; 197 } 198 199 $url = bp_members_get_user_url( $user_id, bp_members_get_path_chunks( $path_chunks ) ); 209 200 210 201 /** -
trunk/src/bp-messages/bp-messages-template.php
r13443 r13503 340 340 $url = bp_members_get_user_url( 341 341 $user_id, 342 array( 343 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_messages', bp_get_messages_slug() ), 344 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_messages_view', 'view' ), 345 'single_item_action_variables' => array( $thread_id ), 346 ) 342 bp_members_get_path_chunks( array( bp_get_messages_slug(), 'view', array( $thread_id ) ) ) 347 343 ); 348 344 … … 390 386 } 391 387 392 $current_action_slug = bp_current_action();393 $current_action_rewrite_id = 'member_messages_' . $current_action_slug;394 $action_variable_delete_slug = bp_rewrites_get_slug( 'members', $current_action_rewrite_id . '_delete', 'delete' );395 396 388 $url = bp_members_get_user_url( 397 389 $user_id, 398 array( 399 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_messages', bp_get_messages_slug() ), 400 'single_item_action' => bp_rewrites_get_slug( 'members', $current_action_rewrite_id, $current_action_slug ), 401 'single_item_action_variables' => array( $action_variable_delete_slug, $messages_template->thread->thread_id ), 402 ) 390 bp_members_get_path_chunks( array( bp_get_messages_slug(), bp_current_action(), array( 'delete', $messages_template->thread->thread_id ) ) ) 403 391 ); 404 392 … … 453 441 } 454 442 455 $current_action_slug = bp_current_action();456 $current_action_rewrite_id = 'member_messages_' . $current_action_slug;457 $action_variable_unread_slug = bp_rewrites_get_slug( 'members', $current_action_rewrite_id . '_unread', 'unread' );458 459 // Base unread URL.460 443 $url = bp_members_get_user_url( 461 444 $user_id, 462 array( 463 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_messages', bp_get_messages_slug() ), 464 'single_item_action' => bp_rewrites_get_slug( 'members', $current_action_rewrite_id, $current_action_slug ), 465 'single_item_action_variables' => array( $action_variable_unread_slug ), 466 ) 445 bp_members_get_path_chunks( array( bp_get_messages_slug(), bp_current_action(), array( 'unread' ) ) ) 467 446 ); 468 447 … … 524 503 } 525 504 526 $current_action_slug = bp_current_action();527 $current_action_rewrite_id = 'member_messages_' . $current_action_slug;528 $action_variable_read_slug = bp_rewrites_get_slug( 'members', $current_action_rewrite_id . '_read', 'read' );529 530 // Base read URL.531 505 $url = bp_members_get_user_url( 532 506 $user_id, 533 array( 534 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_messages', bp_get_messages_slug() ), 535 'single_item_action' => bp_rewrites_get_slug( 'members', $current_action_rewrite_id, $current_action_slug ), 536 'single_item_action_variables' => array( $action_variable_read_slug ), 537 ) 507 bp_members_get_path_chunks( array( bp_get_messages_slug(), bp_current_action(), array( 'read' ) ) ) 538 508 ); 539 509 … … 1337 1307 global $messages_template; 1338 1308 1339 $message_slug = bp_get_messages_slug(); 1340 $custom_message_slug = bp_rewrites_get_slug( 'members', 'member_' . $message_slug, $message_slug ); 1341 $url = wp_nonce_url( 1342 bp_loggedin_user_url( 1343 array( 1344 'single_item_component' => $custom_message_slug, 1345 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $message_slug . '_notices', 'notices' ), 1346 'single_item_action_variables' => array( 1347 bp_rewrites_get_slug( 'members', 'member_' . $message_slug . '_notices_delete', 'delete' ), 1348 $messages_template->thread->id, 1349 ), 1350 ) 1351 ), 1309 $url = wp_nonce_url( 1310 bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_get_messages_slug(), 'notices', array( 'delete', $messages_template->thread->id ) ) ) ), 1352 1311 'messages_delete_notice' 1353 1312 ); … … 1379 1338 global $messages_template; 1380 1339 1381 $message_slug = bp_get_messages_slug(); 1382 $custom_message_slug = bp_rewrites_get_slug( 'members', 'member_' . $message_slug, $message_slug ); 1383 $path_chunks = array( 1384 'single_item_component' => $custom_message_slug, 1385 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $message_slug . '_notices', 'notices' ), 1386 ); 1340 $path_chunks = array( bp_get_messages_slug(), 'notices' ); 1387 1341 1388 1342 if ( 1 === (int) $messages_template->thread->is_active ) { 1389 $nonce = 'messages_deactivate_notice'; 1390 $path_chunks['single_item_action_variables'] = array( 1391 bp_rewrites_get_slug( 'members', 'member_' . $message_slug . '_notices_deactivate', 'deactivate' ), 1392 $messages_template->thread->id, 1393 ); 1343 $nonce = 'messages_deactivate_notice'; 1344 $path_chunks[] = array( 'deactivate', $messages_template->thread->id ); 1394 1345 } else { 1395 $nonce = 'messages_activate_notice'; 1396 $path_chunks['single_item_action_variables'] = array( 1397 bp_rewrites_get_slug( 'members', 'member_' . $message_slug . '_notices_activate', 'activate' ), 1398 $messages_template->thread->id, 1399 ); 1346 $nonce = 'messages_activate_notice'; 1347 $path_chunks[] = array( 'activate', $messages_template->thread->id ); 1400 1348 } 1401 1349 1402 $link = wp_nonce_url( bp_loggedin_user_url( $path_chunks), $nonce );1350 $link = wp_nonce_url( bp_loggedin_user_url( bp_members_get_path_chunks( $path_chunks ) ), $nonce ); 1403 1351 1404 1352 /** … … 1459 1407 */ 1460 1408 function bp_get_message_notice_dismiss_link() { 1461 $message_slug = bp_get_messages_slug(); 1462 $custom_message_slug = bp_rewrites_get_slug( 'members', 'member_' . $message_slug, $message_slug ); 1463 $link = wp_nonce_url( 1464 bp_loggedin_user_url( 1465 array( 1466 'single_item_component' => $custom_message_slug, 1467 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $message_slug . '_notices', 'notices' ), 1468 'single_item_action_variables' => array( bp_rewrites_get_slug( 'members', 'member_' . $message_slug . '_notices_dismiss', 'dismiss' ) ), 1469 ) 1470 ), 1409 $link = wp_nonce_url( 1410 bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_get_messages_slug(), 'notices', array( 'dismiss' ) ) ) ), 1471 1411 'messages_dismiss_notice' 1472 1412 ); … … 1557 1497 } 1558 1498 1559 $message_slug = bp_get_messages_slug(); 1560 $custom_message_slug = bp_rewrites_get_slug( 'members', 'member_' . $message_slug, $message_slug ); 1561 $url = wp_nonce_url( 1499 $url = wp_nonce_url( 1562 1500 add_query_arg( 1563 1501 'r', 1564 1502 bp_members_get_user_slug( bp_displayed_user_id() ), 1565 bp_loggedin_user_url( 1566 array( 1567 'single_item_component' => $custom_message_slug, 1568 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $message_slug . '_compose', 'compose' ), 1569 ) 1570 ) 1571 1503 bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_get_messages_slug(), 'compose' ) ) ) 1572 1504 ) 1573 1505 ); -
trunk/src/bp-messages/classes/class-bp-messages-component.php
r13495 r13503 310 310 // Menus for logged in user. 311 311 if ( is_user_logged_in() ) { 312 $message_slug = bp_get_messages_slug(); 313 $custom_message_slug = bp_rewrites_get_slug( 'members', 'member_' . $message_slug, $message_slug ); 312 $message_slug = bp_get_messages_slug(); 314 313 315 314 // Unread message count. … … 336 335 'id' => 'my-account-' . $this->id, 337 336 'title' => $title, 338 'href' => bp_loggedin_user_url( 339 array( 340 'single_item_component' => $custom_message_slug, 341 ) 342 ), 337 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $message_slug ) ) ), 343 338 ); 344 339 … … 348 343 'id' => 'my-account-' . $this->id . '-inbox', 349 344 'title' => $inbox, 350 'href' => bp_loggedin_user_url( 351 array( 352 'single_item_component' => $custom_message_slug, 353 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $message_slug . '_inbox', 'inbox' ), 354 ) 355 ), 345 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $message_slug, 'inbox' ) ) ), 356 346 'position' => 10, 357 347 ); … … 359 349 // Starred. 360 350 if ( bp_is_active( $this->id, 'star' ) ) { 361 $star_slug = bp_get_messages_starred_slug();362 351 $wp_admin_nav[] = array( 363 352 'parent' => 'my-account-' . $this->id, 364 353 'id' => 'my-account-' . $this->id . '-starred', 365 354 'title' => __( 'Starred', 'buddypress' ), 366 'href' => bp_loggedin_user_url( 367 array( 368 'single_item_component' => $custom_message_slug, 369 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $message_slug . '_' . $star_slug, $star_slug ), 370 ) 371 ), 355 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $message_slug, bp_get_messages_starred_slug() ) ) ), 372 356 'position' => 11, 373 357 ); … … 379 363 'id' => 'my-account-' . $this->id . '-sentbox', 380 364 'title' => __( 'Sent', 'buddypress' ), 381 'href' => bp_loggedin_user_url( 382 array( 383 'single_item_component' => $custom_message_slug, 384 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $message_slug . '_sentbox', 'sentbox' ), 385 ) 386 ), 365 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $message_slug, 'sentbox' ) ) ), 387 366 'position' => 20, 388 367 ); … … 393 372 'id' => 'my-account-' . $this->id . '-compose', 394 373 'title' => __( 'Compose', 'buddypress' ), 395 'href' => bp_loggedin_user_url( 396 array( 397 'single_item_component' => $custom_message_slug, 398 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $message_slug . '_compose', 'compose' ), 399 ) 400 ), 374 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $message_slug, 'compose' ) ) ), 401 375 'position' => 30, 402 376 ); … … 408 382 'id' => 'my-account-' . $this->id . '-notices', 409 383 'title' => __( 'Site Notices', 'buddypress' ), 410 'href' => bp_loggedin_user_url( 411 array( 412 'single_item_component' => $custom_message_slug, 413 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $message_slug . '_notices', 'notices' ), 414 ) 415 ), 384 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $message_slug, 'notices' ) ) ), 416 385 'position' => 90, 417 386 ); -
trunk/src/bp-messages/screens/view.php
r13442 r13503 22 22 } 23 23 24 $thread_id = (int) bp_action_variable( 0 ); 25 $message_slug = bp_get_messages_slug(); 26 $custom_message_slug = bp_rewrites_get_slug( 'members', 'member_' . $message_slug, $message_slug ); 24 $thread_id = (int) bp_action_variable( 0 ); 27 25 28 26 if ( empty( $thread_id ) || ! messages_is_valid_thread( $thread_id ) ) { … … 32 30 33 31 bp_core_redirect( 34 bp_loggedin_user_url( 35 array( 36 'single_item_component' => $custom_message_slug, 37 ) 38 ) 32 bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_get_messages_slug() ) ) ) 39 33 ); 40 34 } … … 52 46 53 47 bp_core_redirect( 54 bp_loggedin_user_url( 55 array( 56 'single_item_component' => $custom_message_slug, 57 ) 58 ) 48 bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_get_messages_slug() ) ) ) 59 49 ); 60 50 } -
trunk/src/bp-notifications/bp-notifications-adminbar.php
r13499 r13503 30 30 31 31 $notifications = bp_notifications_get_notifications_for_user( bp_loggedin_user_id(), 'object' ); 32 $count = ! empty( $notifications ) ? count( $notifications ) : 0; 33 $alert_class = (int) $count > 0 ? 'pending-count alert' : 'count no-alert'; 34 $menu_title = '<span id="ab-pending-notifications" class="' . $alert_class . '">' . number_format_i18n( $count ) . '</span>'; 35 $notifications_slug = bp_get_notifications_slug(); 36 $custom_notifications_slug = bp_rewrites_get_slug( 'members', 'member_' . $notifications_slug, $notifications_slug ); 37 $menu_link = bp_loggedin_user_url( 38 array( 39 'single_item_component' => $custom_notifications_slug, 40 ) 41 ); 32 $count = ! empty( $notifications ) ? count( $notifications ) : 0; 33 $alert_class = (int) $count > 0 ? 'pending-count alert' : 'count no-alert'; 34 $menu_title = '<span id="ab-pending-notifications" class="' . $alert_class . '">' . number_format_i18n( $count ) . '</span>'; 35 $menu_link = bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_get_notifications_slug() ) ) ); 42 36 43 37 // Add the top-level Notifications button. -
trunk/src/bp-notifications/bp-notifications-template.php
r13436 r13503 65 65 $retval = bp_members_get_user_url( 66 66 $user_id, 67 array( 68 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_notifications', bp_get_notifications_slug() ), 69 ) 67 bp_members_get_path_chunks( array( bp_get_notifications_slug() ) ) 70 68 ); 71 69 … … 108 106 $retval = bp_members_get_user_url( 109 107 $user_id, 110 array( 111 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_notifications', bp_get_notifications_slug() ), 112 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_notifications_unread', 'unread' ), 113 ) 108 bp_members_get_path_chunks( array( bp_get_notifications_slug(), 'unread' ) ) 114 109 ); 115 110 … … 151 146 $retval = bp_members_get_user_url( 152 147 $user_id, 153 array( 154 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_notifications', bp_get_notifications_slug() ), 155 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_notifications_read', 'read' ), 156 ) 148 bp_members_get_path_chunks( array( bp_get_notifications_slug(), 'read' ) ) 157 149 ); 158 150 -
trunk/src/bp-notifications/classes/class-bp-notifications-component.php
r13495 r13503 232 232 // Menus for logged in user. 233 233 if ( is_user_logged_in() ) { 234 $notifications_slug = bp_get_notifications_slug(); 235 $custom_notifications_slug = bp_rewrites_get_slug( 'members', 'member_' . $notifications_slug, $notifications_slug ); 234 $notifications_slug = bp_get_notifications_slug(); 236 235 237 236 // Pending notification requests. … … 258 257 'id' => 'my-account-' . $this->id, 259 258 'title' => $title, 260 'href' => bp_loggedin_user_url( 261 array( 262 'single_item_component' => $custom_notifications_slug, 263 ) 264 ), 259 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $notifications_slug ) ) ), 265 260 ); 266 261 … … 270 265 'id' => 'my-account-' . $this->id . '-unread', 271 266 'title' => $unread, 272 'href' => bp_loggedin_user_url( 273 array( 274 'single_item_component' => $custom_notifications_slug, 275 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $notifications_slug . '_unread', 'unread' ), 276 ) 277 ), 267 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $notifications_slug, 'unread' ) ) ), 278 268 'position' => 10, 279 269 ); … … 284 274 'id' => 'my-account-' . $this->id . '-read', 285 275 'title' => _x( 'Read', 'My Account Notification sub nav', 'buddypress' ), 286 'href' => bp_loggedin_user_url( 287 array( 288 'single_item_component' => $custom_notifications_slug, 289 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $notifications_slug . '_read', 'read' ), 290 ) 291 ), 276 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $notifications_slug, 'read' ) ) ), 292 277 'position' => 20, 293 278 ); -
trunk/src/bp-settings/actions/general.php
r13443 r13503 51 51 $feedback = array(); // array of strings for feedback. 52 52 $user_id = bp_displayed_user_id(); // The ID of the user being displayed. 53 $settings_slug = bp_get_settings_slug(); 54 $path_chunks = array( 55 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $settings_slug, $settings_slug ), 56 ); 53 $path_chunks = array( bp_get_settings_slug() ); 57 54 58 55 // Nonce check. … … 235 232 236 233 // Set the URL to redirect the user to. 237 $path_chunks[ 'single_item_action'] = bp_rewrites_get_slug( 'members', 'member_' . $settings_slug . '_general', 'general' );238 $redirect_to = bp_displayed_user_url( $path_chunks);234 $path_chunks[] = 'general'; 235 $redirect_to = bp_displayed_user_url( bp_members_get_path_chunks( $path_chunks ) ); 239 236 240 237 /** … … 271 268 } 272 269 273 $settings_slug = bp_get_settings_slug(); 274 $path_chunks = array( 275 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $settings_slug, $settings_slug ) 276 ); 277 $redirect_to = bp_displayed_user_url( $path_chunks ); 270 $redirect_to = bp_displayed_user_url( bp_members_get_path_chunks( array( bp_get_settings_slug() ) ) ); 278 271 279 272 // Email change is being verified. -
trunk/src/bp-settings/actions/notifications.php
r13443 r13503 54 54 do_action( 'bp_core_notification_settings_after_save' ); 55 55 56 $settings_slug = bp_get_settings_slug(); 57 $path_chunks = array( 58 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $settings_slug, $settings_slug ), 59 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $settings_slug . '_notifications', 'notifications' ), 56 bp_core_redirect( 57 bp_displayed_user_url( bp_members_get_path_chunks( array( bp_get_settings_slug(), 'notifications' ) ) ) 60 58 ); 61 62 bp_core_redirect( bp_displayed_user_url( $path_chunks ) );63 59 } 64 60 add_action( 'bp_actions', 'bp_settings_action_notifications' ); -
trunk/src/bp-settings/bp-settings-template.php
r13443 r13503 81 81 } 82 82 83 $settings_slug = bp_get_settings_slug(); 84 $dismiss_url = wp_nonce_url( 83 $dismiss_url = wp_nonce_url( 85 84 add_query_arg( 86 85 'dismiss_email_change', 87 86 1, 88 87 bp_displayed_user_url( 89 array( 90 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $settings_slug, $settings_slug ), 91 ) 88 bp_members_get_path_chunks( array( bp_get_settings_slug() ) ) 92 89 ) 93 90 ), -
trunk/src/bp-settings/classes/class-bp-settings-component.php
r13495 r13503 240 240 // Menus for logged in user. 241 241 if ( is_user_logged_in() ) { 242 $settings_slug = bp_get_settings_slug(); 243 $custom_settings_slug = bp_rewrites_get_slug( 'members', 'member_' . $settings_slug, $settings_slug ); 242 $settings_slug = bp_get_settings_slug(); 244 243 245 244 // Add main Settings menu. … … 248 247 'id' => 'my-account-' . $this->id, 249 248 'title' => __( 'Settings', 'buddypress' ), 250 'href' => bp_loggedin_user_url( 251 array( 252 'single_item_component' => $custom_settings_slug, 253 ) 254 ), 249 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $settings_slug ) ) ), 255 250 ); 256 251 … … 260 255 'id' => 'my-account-' . $this->id . '-general', 261 256 'title' => __( 'General', 'buddypress' ), 262 'href' => bp_loggedin_user_url( 263 array( 264 'single_item_component' => $custom_settings_slug, 265 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $settings_slug . '_general', 'general' ), 266 ) 267 ), 257 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $settings_slug, 'general' ) ) ), 268 258 'position' => 10, 269 259 ); … … 275 265 'id' => 'my-account-' . $this->id . '-notifications', 276 266 'title' => __( 'Email', 'buddypress' ), 277 'href' => bp_loggedin_user_url( 278 array( 279 'single_item_component' => $custom_settings_slug, 280 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $settings_slug . '_notifications', 'notifications' ), 281 ) 282 ), 267 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $settings_slug, 'notifications' ) ) ), 283 268 'position' => 20, 284 269 ); … … 294 279 'id' => 'my-account-' . $this->id . '-data', 295 280 'title' => __( 'Export Data', 'buddypress' ), 296 'href' => bp_loggedin_user_url( 297 array( 298 'single_item_component' => $custom_settings_slug, 299 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $settings_slug . '_data', 'data' ), 300 ) 301 ), 281 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $settings_slug, 'data' ) ) ), 302 282 'position' => 89, 303 283 ); … … 305 285 306 286 // Delete Account 307 if ( ! bp_current_user_can( 'bp_moderate' ) && ! bp_core_get_root_option( 'bp-disable-account-deletion' ) ) {287 if ( ! bp_current_user_can( 'bp_moderate' ) && ! bp_core_get_root_option( 'bp-disable-account-deletion' ) ) { 308 288 $wp_admin_nav[] = array( 309 289 'parent' => 'my-account-' . $this->id, 310 290 'id' => 'my-account-' . $this->id . '-delete-account', 311 291 'title' => __( 'Delete Account', 'buddypress' ), 312 'href' => bp_loggedin_user_url( 313 array( 314 'single_item_component' => $custom_settings_slug, 315 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $settings_slug . '_delete_account', 'delete-account' ), 316 ) 317 ), 292 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $settings_slug, 'delete-account' ) ) ), 318 293 'position' => 90, 319 294 ); -
trunk/src/bp-templates/bp-legacy/buddypress-functions.php
r13493 r13503 915 915 } 916 916 917 $activity_slug = bp_get_activity_slug();918 $custom_activity_slug = bp_rewrites_get_slug( 'members', 'member_' . $activity_slug, $activity_slug );919 920 917 // We need to calculate and return the feed URL for each scope. 921 918 switch ( $scope ) { 922 919 case 'friends': 923 $feed_url = bp_loggedin_user_url( 924 array( 925 'single_item_component' => $custom_activity_slug, 926 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_friends', 'friends' ), 927 'single_item_action_variables' => array( 'feed' ), 928 ) 929 ); 920 $feed_url = bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_get_activity_slug(), 'friends', array( 'feed' ) ) ) ); 930 921 break; 931 922 case 'groups': 932 $feed_url = bp_loggedin_user_url( 933 array( 934 'single_item_component' => $custom_activity_slug, 935 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_groups', 'groups' ), 936 'single_item_action_variables' => array( 'feed' ), 937 ) 938 ); 923 $feed_url = bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_get_activity_slug(), 'groups', array( 'feed' ) ) ) ); 939 924 break; 940 925 case 'favorites': 941 $feed_url = bp_loggedin_user_url( 942 array( 943 'single_item_component' => $custom_activity_slug, 944 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_favorites', 'favorites' ), 945 'single_item_action_variables' => array( 'feed' ), 946 ) 947 ); 926 $feed_url = bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_get_activity_slug(), 'favorites', array( 'feed' ) ) ) ); 948 927 break; 949 928 case 'mentions': 950 $feed_url = bp_loggedin_user_url( 951 array( 952 'single_item_component' => $custom_activity_slug, 953 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_mentions', 'mentions' ), 954 'single_item_action_variables' => array( 'feed' ), 955 ) 956 ); 929 $feed_url = bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_get_activity_slug(), 'mentions', array( 'feed' ) ) ) ); 957 930 958 931 if ( isset( $_POST['_wpnonce_activity_filter'] ) && wp_verify_nonce( wp_unslash( $_POST['_wpnonce_activity_filter'] ), 'activity_filter' ) ) { … … 1492 1465 } 1493 1466 1494 $friends_slug = bp_get_friends_slug();1495 $custom_friends_slug = bp_rewrites_get_slug( 'members', 'member_' . $friends_slug, $friends_slug );1496 1497 1467 // Trying to cancel friendship. 1498 1468 if ( 'is_friend' == BP_Friends_Friendship::check_is_friend( bp_loggedin_user_id(), $friend_id ) ) { … … 1502 1472 echo __( 'Friendship could not be canceled.', 'buddypress' ); 1503 1473 } else { 1504 $url = bp_loggedin_user_url( 1505 array( 1506 'single_item_component' => $custom_friends_slug, 1507 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_add_friend', 'add-friend' ), 1508 'single_item_action_variables' => array( $friend_id ), 1509 ) 1510 ); 1474 $url = bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_get_friends_slug(), 'add-friend', array( $friend_id ) ) ) ); 1511 1475 echo '<a id="friend-' . esc_attr( $friend_id ) . '" class="friendship-button not_friends add" rel="add" href="' . wp_nonce_url( $url, 'friends_add_friend' ) . '">' . __( 'Add Friend', 'buddypress' ) . '</a>'; 1512 1476 } … … 1519 1483 echo __(' Friendship could not be requested.', 'buddypress' ); 1520 1484 } else { 1521 $url = bp_loggedin_user_url( 1522 array( 1523 'single_item_component' => $custom_friends_slug, 1524 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_requests', 'requests' ), 1525 'single_item_action_variables' => array( 1526 bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_requests_cancel', 'cancel' ), 1527 $friend_id, 1528 ), 1529 ) 1530 ); 1485 $url = bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_get_friends_slug(), 'requests', array( 'cancel', $friend_id ) ) ) ); 1531 1486 echo '<a id="friend-' . esc_attr( $friend_id ) . '" class="remove friendship-button pending_friend requested" rel="remove" href="' . wp_nonce_url( $url, 'friends_withdraw_friendship' ) . '" class="requested">' . __( 'Cancel Friendship Request', 'buddypress' ) . '</a>'; 1532 1487 } … … 1537 1492 1538 1493 if ( friends_withdraw_friendship( bp_loggedin_user_id(), $friend_id ) ) { 1539 $url = bp_loggedin_user_url( 1540 array( 1541 'single_item_component' => $custom_friends_slug, 1542 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_add_friend', 'add-friend' ), 1543 'single_item_action_variables' => array( 1544 $friend_id, 1545 ), 1546 ) 1547 ); 1494 $url = bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_get_friends_slug(), 'add-friend', array( $friend_id ) ) ) ); 1548 1495 echo '<a id="friend-' . esc_attr( $friend_id ) . '" class="friendship-button not_friends add" rel="add" href="' . wp_nonce_url( $url, 'friends_add_friend' ) . '">' . __( 'Add Friend', 'buddypress' ) . '</a>'; 1549 1496 } else { -
trunk/src/bp-templates/bp-nouveau/includes/activity/ajax.php
r13442 r13503 115 115 116 116 if ( 1 === $fav_count ) { 117 $activity_slug = bp_nouveau_get_component_slug( 'activity' ); 118 $custom_activity_slug = bp_rewrites_get_slug( 'members', 'member_' . $activity_slug, $activity_slug ); 119 $activity_favorites_url = bp_loggedin_user_url( 120 array( 121 'single_item_component' => $custom_activity_slug, 122 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_favorites', 'favorites' ), 123 ) 124 ); 117 $activity_favorites_url = bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_nouveau_get_component_slug( 'activity' ), 'favorites' ) ) ); 125 118 126 119 $response['directory_tab'] = '<li id="activity-favorites" data-bp-scope="favorites" data-bp-object="activity"> -
trunk/src/bp-templates/bp-nouveau/includes/activity/functions.php
r13461 r13503 220 220 ) 221 221 ); 222 $activity_slug = bp_nouveau_get_component_slug( 'activity' ); 223 $path_chunks = array( 224 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug, $activity_slug ), 225 ); 222 $activity_slug = bp_nouveau_get_component_slug( 'activity' ); 226 223 227 224 // If the user has favorite create a nav item 228 225 if ( bp_get_total_favorite_count_for_user( bp_loggedin_user_id() ) ) { 229 $path_chunks['single_item_action'] = bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_favorites', 'favorites' );230 231 226 $nav_items['favorites'] = array( 232 227 'component' => 'activity', 233 228 'slug' => 'favorites', // slug is used because BP_Core_Nav requires it, but it's the scope 234 229 'li_class' => array(), 235 'link' => bp_loggedin_user_url( $path_chunks),230 'link' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $activity_slug, 'favorites' ) ) ), 236 231 'text' => __( 'My Favorites', 'buddypress' ), 237 232 'count' => false, … … 242 237 // The friends component is active and user has friends 243 238 if ( bp_is_active( 'friends' ) && bp_get_total_friend_count( bp_loggedin_user_id() ) ) { 244 $friends_slug = bp_nouveau_get_component_slug( 'friends' );245 $path_chunks['single_item_action'] = bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_' . $friends_slug, $friends_slug );246 247 239 $nav_items['friends'] = array( 248 240 'component' => 'activity', 249 241 'slug' => 'friends', // slug is used because BP_Core_Nav requires it, but it's the scope 250 242 'li_class' => array( 'dynamic' ), 251 'link' => bp_loggedin_user_url( $path_chunks),243 'link' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $activity_slug, bp_nouveau_get_component_slug( 'friends' ) ) ) ), 252 244 'text' => __( 'My Friends', 'buddypress' ), 253 245 'count' => '', … … 258 250 // The groups component is active and user has groups 259 251 if ( bp_is_active( 'groups' ) && bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ) { 260 $groups_slug = bp_nouveau_get_component_slug( 'groups' );261 $path_chunks['single_item_action'] = bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_' . $groups_slug, $groups_slug );262 263 252 $nav_items['groups'] = array( 264 253 'component' => 'activity', 265 254 'slug' => 'groups', // slug is used because BP_Core_Nav requires it, but it's the scope 266 255 'li_class' => array( 'dynamic' ), 267 'link' => bp_loggedin_user_url( $path_chunks),256 'link' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $activity_slug, bp_nouveau_get_component_slug( 'groups' ) ) ) ), 268 257 'text' => __( 'My Groups', 'buddypress' ), 269 258 'count' => '', … … 274 263 // Mentions are allowed 275 264 if ( bp_activity_do_mentions() ) { 276 $deprecated_hooks[] = array( 'bp_before_activity_type_tab_mentions', 'activity', 36 ); 277 $path_chunks['single_item_action'] = bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_mentions', 'mentions' ); 278 279 $count = ''; 265 $deprecated_hooks[] = array( 'bp_before_activity_type_tab_mentions', 'activity', 36 ); 266 $count = ''; 267 280 268 if ( bp_get_total_mention_count_for_user( bp_loggedin_user_id() ) ) { 281 269 $count = bp_get_total_mention_count_for_user( bp_loggedin_user_id() ); … … 286 274 'slug' => 'mentions', // slug is used because BP_Core_Nav requires it, but it's the scope 287 275 'li_class' => array( 'dynamic' ), 288 'link' => bp_loggedin_user_url( $path_chunks),276 'link' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $activity_slug, 'mentions' ) ) ), 289 277 'text' => __( 'Mentions', 'buddypress' ), 290 278 'count' => $count, -
trunk/src/bp-templates/bp-nouveau/includes/ajax.php
r13442 r13503 54 54 } 55 55 56 $activity_slug = bp_nouveau_get_component_slug( 'activity' );57 $custom_activity_slug = bp_rewrites_get_slug( 'members', 'member_' . $activity_slug, $activity_slug );58 59 56 // We need to calculate and return the feed URL for each scope. 60 57 switch ( $scope ) { 61 58 case 'friends': 62 $feed_url = bp_loggedin_user_url( 63 array( 64 'single_item_component' => $custom_activity_slug, 65 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_friends', 'friends' ), 66 'single_item_action_variables' => array( 'feed' ), 67 ) 68 ); 59 $feed_url = bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_nouveau_get_component_slug( 'activity' ), 'friends', array( 'feed' ) ) ) ); 69 60 break; 70 61 case 'groups': 71 $feed_url = bp_loggedin_user_url( 72 array( 73 'single_item_component' => $custom_activity_slug, 74 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_groups', 'groups' ), 75 'single_item_action_variables' => array( 'feed' ), 76 ) 77 ); 62 $feed_url = bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_nouveau_get_component_slug( 'activity' ), 'groups', array( 'feed' ) ) ) ); 78 63 break; 79 64 case 'favorites': 80 $feed_url = bp_loggedin_user_url( 81 array( 82 'single_item_component' => $custom_activity_slug, 83 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_favorites', 'favorites' ), 84 'single_item_action_variables' => array( 'feed' ), 85 ) 86 ); 65 $feed_url = bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_nouveau_get_component_slug( 'activity' ), 'favorites', array( 'feed' ) ) ) ); 87 66 break; 88 67 case 'mentions': 89 $feed_url = bp_loggedin_user_url( 90 array( 91 'single_item_component' => $custom_activity_slug, 92 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_mentions', 'mentions' ), 93 'single_item_action_variables' => array( 'feed' ), 94 ) 95 ); 68 $feed_url = bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_nouveau_get_component_slug( 'activity' ), 'mentions', array( 'feed' ) ) ) ); 96 69 97 70 // Get user new mentions -
trunk/src/bp-templates/bp-nouveau/includes/blogs/functions.php
r13461 r13503 28 28 if ( is_user_logged_in() ) { 29 29 $my_blogs_count = bp_get_total_blog_count_for_user( bp_loggedin_user_id() ); 30 $blogs_slug = bp_nouveau_get_component_slug( 'blogs' );31 $path_chunks = array(32 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $blogs_slug, $blogs_slug ),33 );34 30 35 31 // If the user has blogs create a nav item … … 39 35 'slug' => 'personal', // slug is used because BP_Core_Nav requires it, but it's the scope 40 36 'li_class' => array(), 41 'link' => bp_loggedin_user_url( $path_chunks),37 'link' => bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_nouveau_get_component_slug( 'blogs' ) ) ) ), 42 38 'text' => __( 'My Sites', 'buddypress' ), 43 39 'count' => $my_blogs_count, -
trunk/src/bp-templates/bp-nouveau/includes/groups/functions.php
r13472 r13503 464 464 'id' => 'my-account-' . buddypress()->settings->id . '-invites', 465 465 'title' => _x( 'Group Invites', 'Group invitations main menu title', 'buddypress' ), 466 'href' => bp_loggedin_user_url( 467 array( 468 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $settings_slug, $settings_slug ), 469 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $settings_slug . '_invites', 'invites' ), 470 ) 471 ), 466 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $settings_slug, 'invites' ) ) ), 472 467 ); 473 468 … … 568 563 if ( is_user_logged_in() ) { 569 564 $my_groups_count = bp_get_total_group_count_for_user( bp_loggedin_user_id() ); 570 $groups_slug = bp_nouveau_get_component_slug( 'groups' );571 $path_chunks = array(572 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $groups_slug, $groups_slug ),573 );574 565 575 566 // If the user has groups create a nav item 576 567 if ( $my_groups_count ) { 577 $path_chunks['single_item_action'] = bp_rewrites_get_slug( 'members', 'member_' . $groups_slug . '_my_groups', 'my-groups' );578 579 568 $nav_items['personal'] = array( 580 569 'component' => 'groups', 581 570 'slug' => 'personal', // slug is used because BP_Core_Nav requires it, but it's the scope 582 571 'li_class' => array(), 583 'link' => bp_loggedin_user_url( $path_chunks),572 'link' => bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_nouveau_get_component_slug( 'groups' ), 'my-groups' ) ) ), 584 573 'text' => __( 'My Groups', 'buddypress' ), 585 574 'count' => $my_groups_count, -
trunk/src/bp-templates/bp-nouveau/includes/members/functions.php
r13442 r13503 78 78 // If friends component is active and the user has friends 79 79 if ( bp_is_active( 'friends' ) && bp_get_total_friend_count( bp_loggedin_user_id() ) ) { 80 $friends_slug = bp_nouveau_get_component_slug( 'friends' );81 $path_chunks = array(82 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug, $friends_slug ),83 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_my_friends', 'my-friends' ),84 );85 86 80 $nav_items['personal'] = array( 87 81 'component' => 'members', 88 82 'slug' => 'personal', // slug is used because BP_Core_Nav requires it, but it's the scope 89 83 'li_class' => array(), 90 'link' => bp_loggedin_user_url( $path_chunks),84 'link' => bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_nouveau_get_component_slug( 'friends' ), 'my-friends' ) ) ), 91 85 'text' => __( 'My Friends', 'buddypress' ), 92 86 'count' => bp_get_total_friend_count( bp_loggedin_user_id() ), -
trunk/src/bp-xprofile/bp-xprofile-activity.php
r13433 r13503 58 58 $profile_link = bp_members_get_user_url( 59 59 $activity->user_id, 60 array( 61 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_profile', bp_get_profile_slug() ), 62 ) 60 bp_members_get_path_chunks( array( bp_get_profile_slug() ) ) 63 61 ); 64 62 … … 255 253 $profile_link = bp_members_get_user_url( 256 254 $user_id, 257 array( 258 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_profile', bp_get_profile_slug() ), 259 ) 255 bp_members_get_path_chunks( array( bp_get_profile_slug() ) ) 260 256 ); 261 257 -
trunk/src/bp-xprofile/bp-xprofile-template.php
r13484 r13503 408 408 409 409 // Build the form action URL. 410 $profile_slug = bp_get_profile_slug(); 411 $path_chunks = array( 412 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $profile_slug, $profile_slug ), 413 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $profile_slug . '_edit', 'edit' ), 414 'single_item_action_variables' => array( bp_rewrites_get_slug( 'members', 'member_' . $profile_slug . '_edit_group', 'group' ), $group->id ), 415 ); 416 $form_action = bp_displayed_user_url( $path_chunks ); 410 $form_action = bp_displayed_user_url( bp_members_get_path_chunks( array( bp_get_profile_slug(), 'edit', array( 'group', $group->id ) ) ) ); 417 411 418 412 /** … … 1129 1123 1130 1124 // Build the profile field group link. 1131 $profile_slug = bp_get_profile_slug(); 1132 $path_chunks = array( 1133 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $profile_slug, $profile_slug ), 1134 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $profile_slug . '_edit', 'edit' ), 1135 'single_item_action_variables' => array( bp_rewrites_get_slug( 'members', 'member_' . $profile_slug . '_edit_group', 'group' ), $groups[ $i ]->id ), 1136 ); 1137 $link = bp_displayed_user_url( $path_chunks ); 1125 $link = bp_displayed_user_url( bp_members_get_path_chunks( array( bp_get_profile_slug(), 'edit', array( 'group', $groups[ $i ]->id ) ) ) ); 1138 1126 1139 1127 // Add tab to end of tabs array. … … 1293 1281 */ 1294 1282 function bp_edit_profile_button() { 1295 $profile_slug = bp_get_profile_slug();1296 $path_chunks = array(1297 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $profile_slug, $profile_slug ),1298 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $profile_slug . '_edit', 'edit' ),1299 );1300 1301 1283 bp_button( array( 1302 1284 'id' => 'edit_profile', … … 1304 1286 'must_be_logged_in' => true, 1305 1287 'block_self' => true, 1306 'link_href' => bp_displayed_user_url( $path_chunks),1288 'link_href' => bp_displayed_user_url( bp_members_get_path_chunks( array( bp_get_profile_slug(), 'edit' ) ) ), 1307 1289 'link_class' => 'edit', 1308 1290 'link_text' => __( 'Edit Profile', 'buddypress' ), -
trunk/src/bp-xprofile/classes/class-bp-xprofile-component.php
r13495 r13503 289 289 if ( is_user_logged_in() ) { 290 290 $profile_slug = bp_get_profile_slug(); 291 $path_chunks = array(292 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $profile_slug, $profile_slug ),293 );294 291 295 292 // Add the "Profile" sub menu. … … 298 295 'id' => 'my-account-' . $this->id, 299 296 'title' => _x( 'Profile', 'My Account Profile', 'buddypress' ), 300 'href' => bp_loggedin_user_url( $path_chunks),297 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $profile_slug ) ) ), 301 298 ); 302 303 $path_chunks['single_item_action'] = bp_rewrites_get_slug( 'members', 'member_' . $profile_slug . '_public', 'public' );304 299 305 300 // View Profile. … … 308 303 'id' => 'my-account-' . $this->id . '-public', 309 304 'title' => _x( 'View', 'My Account Profile sub nav', 'buddypress' ), 310 'href' => bp_loggedin_user_url( $path_chunks),305 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $profile_slug, 'public' ) ) ), 311 306 'position' => 10, 312 307 ); 313 314 $path_chunks['single_item_action'] = bp_rewrites_get_slug( 'members', 'member_' . $profile_slug . '_edit', 'edit' );315 308 316 309 // Edit Profile. … … 319 312 'id' => 'my-account-' . $this->id . '-edit', 320 313 'title' => _x( 'Edit', 'My Account Profile sub nav', 'buddypress' ), 321 'href' => bp_loggedin_user_url( $path_chunks),314 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( $profile_slug, 'edit' ) ) ), 322 315 'position' => 20, 323 316 ); … … 392 385 */ 393 386 public function setup_settings_admin_nav( $wp_admin_nav ) { 394 395 // Setup the logged in user variables.396 $settings_slug = bp_get_settings_slug();397 $path_chunks = array(398 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $settings_slug, $settings_slug ),399 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $settings_slug . '_profile', 'profile' ),400 );401 402 387 // Add the "Profile" subnav item. 403 388 $wp_admin_nav[] = array( … … 405 390 'id' => 'my-account-' . buddypress()->settings->id . '-profile', 406 391 'title' => _x( 'Profile', 'My Account Settings sub nav', 'buddypress' ), 407 'href' => bp_loggedin_user_url( $path_chunks),392 'href' => bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_get_settings_slug(), 'profile' ) ) ), 408 393 ); 409 394 -
trunk/src/bp-xprofile/screens/edit.php
r13468 r13503 21 21 } 22 22 23 $profile_slug = bp_get_profile_slug();24 $path_chunks = array(25 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $profile_slug, $profile_slug ),26 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $profile_slug . '_edit', 'edit' ),27 );28 29 30 23 // Make sure a group is set. 31 24 if ( ! bp_action_variable( 1 ) ) { 32 $path_chunks['single_item_action_variables'] = array( bp_rewrites_get_slug( 'members', 'member_' . $profile_slug . '_edit_group', 'group' ), 1 ); 33 bp_core_redirect( bp_displayed_user_url( $path_chunks ) ); 25 bp_core_redirect( 26 bp_displayed_user_url( bp_members_get_path_chunks( array( bp_get_profile_slug(), 'edit', array( 'group', 1 ) ) ) ) 27 ); 34 28 } 35 29 … … 41 35 42 36 // No errors. 43 $errors = false; 37 $errors = false; 38 $path_chunks = array( bp_get_profile_slug(), 'edit' ); 44 39 45 40 // Check to see if any new information has been submitted. … … 51 46 // Check we have field ID's. 52 47 if ( empty( $_POST['field_ids'] ) ) { 53 $path_chunks[ 'single_item_action_variables'] = array( bp_rewrites_get_slug( 'members', 'member_' . $profile_slug . '_edit_group', 'group' ), bp_action_variable( 1 ) );54 bp_core_redirect( bp_displayed_user_url( $path_chunks) );48 $path_chunks[] = array( 'group', bp_action_variable( 1 ) ); 49 bp_core_redirect( bp_displayed_user_url( bp_members_get_path_chunks( $path_chunks ) ) ); 55 50 } 56 51 … … 165 160 166 161 // Redirect back to the edit screen to display the updates and message. 167 $path_chunks[ 'single_item_action_variables'] = array( bp_rewrites_get_slug( 'members', 'member_' . $profile_slug . '_edit_group', 'group' ), bp_action_variable( 1 ) );168 bp_core_redirect( bp_displayed_user_url( $path_chunks) );162 $path_chunks[] = array( 'group', bp_action_variable( 1 ) ); 163 bp_core_redirect( bp_displayed_user_url( bp_members_get_path_chunks( $path_chunks ) ) ); 169 164 } 170 165 } -
trunk/src/bp-xprofile/screens/settings-profile.php
r13443 r13503 110 110 do_action( 'bp_xprofile_settings_after_save' ); 111 111 112 // Redirect to the root domain. 113 $settings_slug = bp_get_settings_slug(); 114 $path_chunks = array( 115 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $settings_slug, $settings_slug ), 116 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $settings_slug . '_profile', 'profile' ), 112 // Redirect to the User's profile settings. 113 bp_core_redirect( 114 bp_displayed_user_url( bp_members_get_path_chunks( array( bp_get_settings_slug(), 'profile' ) ) ) 117 115 ); 118 bp_core_redirect( bp_displayed_user_url( $path_chunks ) );119 116 } 120 117 add_action( 'bp_actions', 'bp_xprofile_action_settings' ); -
trunk/tests/phpunit/testcases/groups/template.php
r13437 r13503 1006 1006 public function test_bp_bp_get_group_form_action() { 1007 1007 $g = $this->factory->group->create(); 1008 $p = 2;1008 $p = 'members'; 1009 1009 $url = bp_get_group_url( 1010 1010 $g,
Note: See TracChangeset
for help on using the changeset viewer.