Skip to:
Content

BuddyPress.org

Changeset 13503


Ignore:
Timestamp:
06/18/2023 04:11:04 AM (3 years ago)
Author:
imath
Message:

BP Rewrites: optimize the code used to build URLs

The bp_members_get_path_chunks() & bp_groups_get_path_chunks() functions are making sure URL chunks are customized according to the slugs settings. Instead of redoing at many places all or some of the operations performed by these functions, update the code to build URLs so that it uses these functions.

See #4954
Fixes #8923
Closes https://github.com/buddypress/buddypress/pull/117

Location:
trunk
Files:
56 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/actions/feeds.php

    r13443 r13503  
    5555        }
    5656
    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() ) ) );
    6358
    6459        // Setup the feed.
     
    9590        }
    9691
    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() ) ) );
    10593
    10694        // Setup the feed.
     
    138126
    139127        // 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() ) ) );
    150131
    151132        // Setup the feed.
     
    190171        }
    191172
    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' ) ) );
    199174
    200175        // Setup the feed.
     
    234209
    235210        // 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' ) ) );
    245214
    246215        // Setup the feed.
  • trunk/src/bp-activity/bp-activity-notifications.php

    r13500 r13503  
    3535                case 'new_at_mention':
    3636                        $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' ) ) );
    4338
    4439                        /* translators: %s: the current user display name */
  • trunk/src/bp-activity/bp-activity-template.php

    r13500 r13503  
    38923892        function bp_get_member_activity_feed_link() {
    38933893                $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 );
    38973895
    38983896                // Single member activity feed link.
    38993897                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 ) );
    39023900
    39033901                // Friend feed link.
    39043902                } 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 ) );
    39093906
    39103907                // Group feed link.
    39113908                } 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 ) );
    39163912
    39173913                // Favorites activity feed link.
    39183914                } 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 ) );
    39223918
    39233919                // Mentions activity feed link.
    39243920                } 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 ) );
    39283924
    39293925                // No feed link.
  • trunk/src/bp-activity/classes/class-bp-activity-component.php

    r13495 r13503  
    336336
    337337                        // 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();
    340339
    341340                        // Unread message count.
    342341                        if ( bp_activity_do_mentions() ) {
    343342                                $count = bp_get_total_mention_count_for_user( bp_loggedin_user_id() );
    344                                 if ( !empty( $count ) ) {
     343                                if ( ! empty( $count ) ) {
    345344                                        $title = sprintf(
    346345                                                /* translators: %s: Unread mention count for the current user */
     
    358357                                'id'     => 'my-account-' . $this->id,
    359358                                '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 ) ) ),
    365360                        );
    366361
     
    370365                                'id'       => 'my-account-' . $this->id . '-personal',
    371366                                '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' ) ) ),
    378368                                'position' => 10,
    379369                        );
     
    385375                                        'id'       => 'my-account-' . $this->id . '-mentions',
    386376                                        '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' ) ) ),
    393378                                        'position' => 20,
    394379                                );
     
    401386                                        'id'       => 'my-account-' . $this->id . '-favorites',
    402387                                        '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' ) ) ),
    409389                                        'position' => 30,
    410390                                );
     
    413393                        // Friends?
    414394                        if ( bp_is_active( 'friends' ) ) {
    415                                 $friends_slug   = bp_get_friends_slug();
    416395                                $wp_admin_nav[] = array(
    417396                                        'parent'   => 'my-account-' . $this->id,
    418397                                        'id'       => 'my-account-' . $this->id . '-friends',
    419398                                        '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() ) ) ),
    426400                                        'position' => 40,
    427401                                );
     
    430404                        // Groups?
    431405                        if ( bp_is_active( 'groups' ) ) {
    432                                 $groups_slug    = bp_get_groups_slug();
    433406                                $wp_admin_nav[] = array(
    434407                                        'parent'   => 'my-account-' . $this->id,
    435408                                        'id'       => 'my-account-' . $this->id . '-groups',
    436409                                        '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() ) ) ),
    443411                                        'position' => 50
    444412                                );
  • trunk/src/bp-activity/screens/permalink.php

    r13446 r13503  
    3939        // Do not redirect at default.
    4040        $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 ) );
    4542
    4643        // Redirect based on the type of activity.
  • trunk/src/bp-blogs/classes/class-bp-blogs-component.php

    r13495 r13503  
    300300
    301301                        // 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();
    304303
    305304                        // Add the "Sites" sub menu.
     
    308307                                'id'     => 'my-account-' . $this->id,
    309308                                '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 ) ) ),
    315310                        );
    316311
     
    320315                                'id'       => 'my-account-' . $this->id . '-my-sites',
    321316                                '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' ) ) ),
    328318                                'position' => 10,
    329319                        );
  • trunk/src/bp-core/bp-core-buddybar.php

    r13500 r13503  
    755755                                        // Try 'activity' first.
    756756                                        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'.
    764760                                        } 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() ) ) );
    771762                                        }
    772763
  • trunk/src/bp-core/bp-core-filters.php

    r13481 r13503  
    12521252                                        bp_members_get_user_url(
    12531253                                                $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' ) )
    12581255                                        )
    12591256                                );
  • trunk/src/bp-core/bp-core-functions.php

    r13502 r13503  
    43624362                        $redirect_to = bp_members_get_user_url(
    43634363                                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' ) )
    43684365                        );
    43694366                } else {
     
    43944391                        $redirect_to = bp_members_get_user_url(
    43954392                                $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' ) )
    44004394                        );
    44014395                } else {
  • trunk/src/bp-core/deprecated/12.0.php

    r13493 r13503  
    14241424function bp_friend_search_form() {
    14251425        _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' ) ) ) );
    14351428        ?>
    14361429
     
    15021495function bp_group_search_form() {
    15031496        _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' ) ) ) );
    15141500
    15151501        $search_form_html = '<form action="' . esc_url( $action ) . '" id="group-search-form" method="post">
  • trunk/src/bp-friends/bp-friends-blocks.php

    r13488 r13503  
    113113        $link = bp_members_get_user_url(
    114114                $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() ) )
    118116        );
    119117
  • trunk/src/bp-friends/bp-friends-functions.php

    r13433 r13503  
    881881                                bp_members_get_user_url(
    882882                                        $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' ) )
    887884                                )
    888885                        ),
  • trunk/src/bp-friends/bp-friends-notifications.php

    r13441 r13503  
    2929 */
    3030function 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();
    3332
    3433        switch ( $action ) {
    3534                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' ) ) );
    4236
    4337                        // $action and $amount are used to generate dynamic filter names.
     
    6155                                'new',
    6256                                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' ) ) )
    6958                        );
    7059
  • trunk/src/bp-friends/bp-friends-template.php

    r13493 r13503  
    222222
    223223                $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();
    226225
    227226                if ( empty( $friendship_status ) ) {
     
    239238                                        'wrapper_id'        => 'friendship-button-' . $potential_friend_id,
    240239                                        '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 ) ) ) ),
    248241                                                'friends_withdraw_friendship'
    249242                                        ),
     
    264257                                        'wrapper_class'     => 'friendship-button awaiting_response_friend',
    265258                                        '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' ) ) ),
    272260                                        'link_text'         => __( 'Friendship Requested', 'buddypress' ),
    273261                                        'link_title'        => __( 'Friendship Requested', 'buddypress' ),
     
    287275                                        'wrapper_id'        => 'friendship-button-' . $potential_friend_id,
    288276                                        '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 ) ) ) ),
    296278                                                'friends_remove_friend'
    297279                                        ),
     
    313295                                        'wrapper_id'        => 'friendship-button-' . $potential_friend_id,
    314296                                        '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 ) ) ) ),
    322298                                                'friends_add_friend'
    323299                                        ),
     
    488464                }
    489465
    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 ) ) ) ),
    499468                        'friends_accept_friendship'
    500469                );
     
    537506                }
    538507
    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 ) ) ) ),
    548510                        'friends_reject_friendship'
    549511                );
  • trunk/src/bp-friends/classes/class-bp-friends-component.php

    r13495 r13503  
    242242
    243243                        // 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();
    246245
    247246                        // Pending friend requests.
     
    268267                                'id'     => 'my-account-' . $this->id,
    269268                                '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 ) ) ),
    275270                        );
    276271
     
    280275                                'id'       => 'my-account-' . $this->id . '-friendships',
    281276                                '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' ) ) ),
    288278                                'position' => 10,
    289279                        );
     
    294284                                'id'       => 'my-account-' . $this->id . '-requests',
    295285                                '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' ) ) ),
    302287                                'position' => 20,
    303288                        );
  • trunk/src/bp-friends/screens/requests.php

    r13441 r13503  
    5454
    5555        if ( $redirect ) {
    56                 $friends_slug = bp_get_friends_slug();
    57 
    5856                bp_core_redirect(
    5957                        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' ) )
    6459                        )
    6560                );
  • trunk/src/bp-groups/actions/leave-group.php

    r13441 r13503  
    5050
    5151                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() ) ) );
    5853                }
    5954
  • trunk/src/bp-groups/bp-groups-adminbar.php

    r13441 r13503  
    8383                                        'id'     => $menu->slug,
    8484                                        'title'  => $title,
    85                                         'href'   => bp_get_group_url(
     85                                        'href'   => bp_get_group_manage_url(
    8686                                                $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' )
    9188                                        ),
    9289                                )
  • trunk/src/bp-groups/bp-groups-notifications.php

    r13446 r13503  
    340340        $invited_link = bp_members_get_user_url(
    341341                $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' ) )
    346343        );
    347344
     
    418415                                                'n' => 1,
    419416                                        ),
    420                                         bp_get_group_url(
     417                                        bp_get_group_manage_url(
    421418                                                $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' )
    426420                                        )
    427421                                );
     
    476470                                                'n' => 1,
    477471                                        ),
    478                                         bp_get_group_url(
     472                                        bp_get_group_manage_url(
    479473                                                $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' )
    484475                                        )
    485476                                );
     
    532523                        $group_id = $item_id;
    533524
    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';
    539528
    540529                        if ( (int) $total_items > 1 ) {
     
    545534                                        'n',
    546535                                        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() ) ) )
    552537                                );
    553538
     
    633618                        $group_id = $item_id;
    634619
    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';
    640623
    641624                        if ( (int) $total_items > 1 ) {
     
    646629                                        'n',
    647630                                        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() ) ) )
    653632                                );
    654633
     
    733712                        $group_id = $item_id;
    734713
    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';
    740717
    741718                        if ( (int) $total_items > 1 ) {
     
    746723                                        'n',
    747724                                        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() ) ) )
    753726                                );
    754727
     
    827800                        $group_id = $item_id;
    828801
    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';
    834805
    835806                        if ( (int) $total_items > 1 ) {
     
    840811                                        'n',
    841812                                        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() ) ) )
    847814                                );
    848815
     
    922889                        $group              = groups_get_group( $group_id );
    923890                        $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 );
    926891                        $amount             = 'single';
    927892                        $notification_link  = add_query_arg(
    928893                                'n',
    929894                                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' ) ) )
    936896                        );
    937897
     
    13371297                                bp_members_get_user_url(
    13381298                                        $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() ) )
    13421300                                )
    13431301                        ),
  • trunk/src/bp-groups/bp-groups-template.php

    r13496 r13503  
    29452945        function bp_get_group_form_action( $page, $group = false ) {
    29462946                $group = bp_get_group( $group );
     2947                $url   = '';
    29472948
    29482949                if ( empty( $group->id ) || empty( $page ) ) {
    2949                         return '';
     2950                        return $url;
    29502951                }
    29512952
    29522953                $screens = bp_get_group_screens( 'read' );
    29532954                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                }
    29632960
    29642961                /**
     
    30012998        function bp_get_group_admin_form_action( $page = false, $group = false ) {
    30022999                $group = bp_get_group( $group );
     3000                $url   = '';
    30033001
    30043002                if ( empty( $group->id ) ) {
    3005                         return '';
     3003                        return $url;
    30063004                }
    30073005
     
    30123010                $screens = bp_get_group_screens( 'manage' );
    30133011                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                }
    30243017
    30253018                /**
     
    32123205                }
    32133206
    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 ) ) );
    32203208
    32213209                if ( bp_is_user() ) {
     
    32653253                }
    32663254
    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 ) ) );
    32733256
    32743257                if ( bp_is_user() ) {
  • trunk/src/bp-groups/classes/class-bp-groups-component.php

    r13492 r13503  
    765765                        if ( bp_is_item_admin() ) {
    766766                                // 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 );
    774768
    775769                                // Common params to all nav items.
     
    840834
    841835                        // 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();
    844837
    845838                        $title   = _x( 'Groups', 'My Account Groups', 'buddypress' );
     
    869862                                'id'     => 'my-account-' . $this->id,
    870863                                '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 ) ) ),
    876865                        );
    877866
     
    881870                                'id'       => 'my-account-' . $this->id . '-memberships',
    882871                                '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' ) ) ),
    889873                                'position' => 10,
    890874                        );
     
    896880                                        'id'       => 'my-account-' . $this->id . '-invites',
    897881                                        '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' ) ) ),
    904883                                        'position' => 30,
    905884                                );
  • trunk/src/bp-groups/screens/single/admin/delete-group.php

    r13441 r13503  
    1919        }
    2020
    21         if ( ! bp_is_item_admin() && !bp_current_user_can( 'bp_moderate' ) ) {
     21        if ( ! bp_is_item_admin() && ! bp_current_user_can( 'bp_moderate' ) ) {
    2222                return false;
    2323        }
     
    2727        if ( isset( $_REQUEST['delete-group-button'] ) && isset( $_REQUEST['delete-group-understand'] ) ) {
    2828                $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() ) ) );
    3430
    3531                // Check the nonce first.
  • trunk/src/bp-members/actions/invitations-bulk-manage.php

    r13443 r13503  
    7777        }
    7878
    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 ) );
    8782
    8883        // Redirect.
  • trunk/src/bp-members/bp-members-adminbar.php

    r13493 r13503  
    211211
    212212        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();
    216215
    217216                $wp_admin_bar->add_node(
     
    220219                                'parent' => $bp->my_account_menu_id,
    221220                                '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 ) ) ),
    227222                                'meta'   => array(
    228223                                        'class'  => 'ab-sub-secondary'
     
    237232                                        'parent' => $bp->my_account_menu_id . '-invitations',
    238233                                        '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' ) ) ),
    245235                                        'meta'   => array(
    246236                                                'class'  => 'ab-sub-secondary'
     
    255245                                'parent' => $bp->my_account_menu_id . '-invitations',
    256246                                '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' ) ) ),
    263248                                'meta'   => array(
    264249                                        'class'  => 'ab-sub-secondary'
  • trunk/src/bp-members/bp-members-filters.php

    r13436 r13503  
    111111                $profile_link = bp_members_get_user_url(
    112112                        $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' ) )
    117114                );
    118115
  • trunk/src/bp-members/bp-members-template.php

    r13443 r13503  
    30943094                }
    30953095
    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.
    31013099                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.
    31073107                $url = bp_displayed_user_url( $path_chunks );
    31083108
     
    31473147                $url          = wp_nonce_url(
    31483148                        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' ) ) )
    31543150                        ),
    31553151                        'bp_delete_avatar_link'
     
    36793675                $retval = bp_members_get_user_url(
    36803676                        (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' ) )
    36853678                );
    36863679
     
    37213714                $retval = bp_members_get_user_url(
    37223715                        (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' ) )
    37273717                );
    37283718
  • trunk/src/bp-members/classes/class-bp-members-component.php

    r13499 r13503  
    534534         */
    535535        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();
    539538
    540539                if ( ! $admin_bar_menu_id ) {
     
    548547                                'id'       => 'my-account-' . $admin_bar_menu_id . '-change-avatar',
    549548                                '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' ) ) ),
    556550                                'position' => 30,
    557551                        );
     
    564558                                'id'       => 'my-account-' . $admin_bar_menu_id . '-change-cover-image',
    565559                                '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' ) ) ),
    572561                                'position' => 40,
    573562                        );
     
    587576                // Menus for logged in user.
    588577                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();
    591579
    592580                        if ( ! bp_is_active( 'xprofile' ) ) {
     
    596584                                        'id'     => 'my-account-' . $this->id,
    597585                                        '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 ) ) ),
    603587                                );
    604588
     
    608592                                        'id'       => 'my-account-' . $this->id . '-public',
    609593                                        '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' ) ) ),
    616595                                        'position' => 10,
    617596                                );
  • trunk/src/bp-messages/actions/compose.php

    r13442 r13503  
    4444
    4545                // 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() );
    5147
    5248                // Site-wide notice.
     
    5551                        // Attempt to save the notice and redirect to notices.
    5652                        if ( messages_send_notice( $_POST['subject'], $_POST['content'] ) ) {
    57                                 $success                           = true;
    58                                 $feedback                          = __( 'Notice successfully created.', 'buddypress' );
    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 ) );
    6157
    6258                        // Notice could not be sent.
     
    9389                        // Send the message and redirect to it.
    9490                        if ( true === is_int( $send ) ) {
    95                                 $success                                     = true;
    96                                 $feedback                                    = __( 'Message successfully sent.', 'buddypress' );
    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 ) );
    10096
    10197                        // Message could not be sent.
  • trunk/src/bp-messages/actions/notices.php

    r13442 r13503  
    8787
    8888        // 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' ) ) );
    9790
    9891        bp_core_redirect( $redirect_to );
     
    138131
    139132        // 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() ) ) );
    147134
    148135        bp_core_redirect( $redirect_to );
  • trunk/src/bp-messages/actions/star.php

    r13443 r13503  
    4242
    4343        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() ) ) );
    5045        }
    5146
  • trunk/src/bp-messages/bp-messages-functions.php

    r13433 r13503  
    630630                                        bp_members_get_user_url(
    631631                                                $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 ) ) )
    637633                                        )
    638634                                ),
  • trunk/src/bp-messages/bp-messages-notifications.php

    r13442 r13503  
    2525 */
    2626function 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';
    3932
    4033        if ( 'new_message' === $action ) {
  • trunk/src/bp-messages/bp-messages-star.php

    r13442 r13503  
    114114                );
    115115
    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 ) ) {
    121119                        return '';
    122120                }
    123121
    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() );
    131124
    132125                // Define local variables.
     
    175168
    176169                        if ( true === $is_starred ) {
    177                                 $action                                      = 'unstar';
    178                                 $bulk_attr                                   = ' data-star-bulk="1"';
    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' );
    181174                        } else {
    182                                 $action                                      = 'star';
    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 );
    185178                        }
    186179
     
    194187
    195188                        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';
    199190                        } else {
    200                                 $action                                      = 'star';
    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 ) );
    209200
    210201                /**
  • trunk/src/bp-messages/bp-messages-template.php

    r13443 r13503  
    340340                $url = bp_members_get_user_url(
    341341                        $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 ) ) )
    347343                );
    348344
     
    390386                }
    391387
    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 
    396388                $url = bp_members_get_user_url(
    397389                        $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 ) ) )
    403391                );
    404392
     
    453441                }
    454442
    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.
    460443                $url = bp_members_get_user_url(
    461444                        $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' ) ) )
    467446                );
    468447
     
    524503                }
    525504
    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.
    531505                $url = bp_members_get_user_url(
    532506                        $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' ) ) )
    538508                );
    539509
     
    13371307                global $messages_template;
    13381308
    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 ) ) ) ),
    13521311                        'messages_delete_notice'
    13531312                );
     
    13791338                global $messages_template;
    13801339
    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' );
    13871341
    13881342                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 );
    13941345                } 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 );
    14001348                }
    14011349
    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 );
    14031351
    14041352                /**
     
    14591407         */
    14601408        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' ) ) ) ),
    14711411                        'messages_dismiss_notice'
    14721412                );
     
    15571497                }
    15581498
    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(
    15621500                        add_query_arg(
    15631501                                'r',
    15641502                                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' ) ) )
    15721504                        )
    15731505                );
  • trunk/src/bp-messages/classes/class-bp-messages-component.php

    r13495 r13503  
    310310                // Menus for logged in user.
    311311                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();
    314313
    315314                        // Unread message count.
     
    336335                                'id'     => 'my-account-' . $this->id,
    337336                                '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 ) ) ),
    343338                        );
    344339
     
    348343                                'id'       => 'my-account-' . $this->id . '-inbox',
    349344                                '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' ) ) ),
    356346                                'position' => 10,
    357347                        );
     
    359349                        // Starred.
    360350                        if ( bp_is_active( $this->id, 'star' ) ) {
    361                                 $star_slug      = bp_get_messages_starred_slug();
    362351                                $wp_admin_nav[] = array(
    363352                                        'parent'   => 'my-account-' . $this->id,
    364353                                        'id'       => 'my-account-' . $this->id . '-starred',
    365354                                        '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() ) ) ),
    372356                                        'position' => 11,
    373357                                );
     
    379363                                'id'       => 'my-account-' . $this->id . '-sentbox',
    380364                                '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' ) ) ),
    387366                                'position' => 20,
    388367                        );
     
    393372                                'id'       => 'my-account-' . $this->id . '-compose',
    394373                                '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' ) ) ),
    401375                                'position' => 30,
    402376                        );
     
    408382                                        'id'       => 'my-account-' . $this->id . '-notices',
    409383                                        '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' ) ) ),
    416385                                        'position' => 90,
    417386                                );
  • trunk/src/bp-messages/screens/view.php

    r13442 r13503  
    2222        }
    2323
    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 );
    2725
    2826        if ( empty( $thread_id ) || ! messages_is_valid_thread( $thread_id ) ) {
     
    3230
    3331                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() ) ) )
    3933                );
    4034        }
     
    5246
    5347                        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() ) ) )
    5949                        );
    6050                }
  • trunk/src/bp-notifications/bp-notifications-adminbar.php

    r13499 r13503  
    3030
    3131        $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() ) ) );
    4236
    4337        // Add the top-level Notifications button.
  • trunk/src/bp-notifications/bp-notifications-template.php

    r13436 r13503  
    6565                $retval = bp_members_get_user_url(
    6666                        $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() ) )
    7068                );
    7169
     
    108106                $retval = bp_members_get_user_url(
    109107                        $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' ) )
    114109                );
    115110
     
    151146                $retval = bp_members_get_user_url(
    152147                        $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' ) )
    157149                );
    158150
  • trunk/src/bp-notifications/classes/class-bp-notifications-component.php

    r13495 r13503  
    232232                // Menus for logged in user.
    233233                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();
    236235
    237236                        // Pending notification requests.
     
    258257                                'id'     => 'my-account-' . $this->id,
    259258                                '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 ) ) ),
    265260                        );
    266261
     
    270265                                'id'       => 'my-account-' . $this->id . '-unread',
    271266                                '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' ) ) ),
    278268                                'position' => 10,
    279269                        );
     
    284274                                'id'       => 'my-account-' . $this->id . '-read',
    285275                                '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' ) ) ),
    292277                                'position' => 20,
    293278                        );
  • trunk/src/bp-settings/actions/general.php

    r13443 r13503  
    5151        $feedback      = array();                // array of strings for feedback.
    5252        $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() );
    5754
    5855        // Nonce check.
     
    235232
    236233        // 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 ) );
    239236
    240237        /**
     
    271268        }
    272269
    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() ) ) );
    278271
    279272        // Email change is being verified.
  • trunk/src/bp-settings/actions/notifications.php

    r13443 r13503  
    5454        do_action( 'bp_core_notification_settings_after_save' );
    5555
    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' ) ) )
    6058        );
    61 
    62         bp_core_redirect( bp_displayed_user_url( $path_chunks ) );
    6359}
    6460add_action( 'bp_actions', 'bp_settings_action_notifications' );
  • trunk/src/bp-settings/bp-settings-template.php

    r13443 r13503  
    8181        }
    8282
    83         $settings_slug = bp_get_settings_slug();
    84         $dismiss_url   = wp_nonce_url(
     83        $dismiss_url = wp_nonce_url(
    8584                add_query_arg(
    8685                        'dismiss_email_change',
    8786                        1,
    8887                        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() ) )
    9289                        )
    9390                ),
  • trunk/src/bp-settings/classes/class-bp-settings-component.php

    r13495 r13503  
    240240                // Menus for logged in user.
    241241                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();
    244243
    245244                        // Add main Settings menu.
     
    248247                                'id'     => 'my-account-' . $this->id,
    249248                                '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 ) ) ),
    255250                        );
    256251
     
    260255                                'id'       => 'my-account-' . $this->id . '-general',
    261256                                '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' ) ) ),
    268258                                'position' => 10,
    269259                        );
     
    275265                                        'id'       => 'my-account-' . $this->id . '-notifications',
    276266                                        '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' ) ) ),
    283268                                        'position' => 20,
    284269                                );
     
    294279                                        'id'       => 'my-account-' . $this->id . '-data',
    295280                                        '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' ) ) ),
    302282                                        'position' => 89,
    303283                                );
     
    305285
    306286                        // 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' ) ) {
    308288                                $wp_admin_nav[] = array(
    309289                                        'parent'   => 'my-account-' . $this->id,
    310290                                        'id'       => 'my-account-' . $this->id . '-delete-account',
    311291                                        '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' ) ) ),
    318293                                        'position' => 90,
    319294                                );
  • trunk/src/bp-templates/bp-legacy/buddypress-functions.php

    r13493 r13503  
    915915        }
    916916
    917         $activity_slug        = bp_get_activity_slug();
    918         $custom_activity_slug = bp_rewrites_get_slug( 'members', 'member_' . $activity_slug, $activity_slug );
    919 
    920917        // We need to calculate and return the feed URL for each scope.
    921918        switch ( $scope ) {
    922919                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' ) ) ) );
    930921                        break;
    931922                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' ) ) ) );
    939924                        break;
    940925                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' ) ) ) );
    948927                        break;
    949928                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' ) ) ) );
    957930
    958931                        if ( isset( $_POST['_wpnonce_activity_filter'] ) && wp_verify_nonce( wp_unslash( $_POST['_wpnonce_activity_filter'] ), 'activity_filter' ) ) {
     
    14921465        }
    14931466
    1494         $friends_slug        = bp_get_friends_slug();
    1495         $custom_friends_slug = bp_rewrites_get_slug( 'members', 'member_' . $friends_slug, $friends_slug );
    1496 
    14971467        // Trying to cancel friendship.
    14981468        if ( 'is_friend' == BP_Friends_Friendship::check_is_friend( bp_loggedin_user_id(), $friend_id ) ) {
     
    15021472                        echo __( 'Friendship could not be canceled.', 'buddypress' );
    15031473                } 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 ) ) ) );
    15111475                        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>';
    15121476                }
     
    15191483                        echo __(' Friendship could not be requested.', 'buddypress' );
    15201484                } 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 ) ) ) );
    15311486                        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>';
    15321487                }
     
    15371492
    15381493                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 ) ) ) );
    15481495                        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>';
    15491496                } else {
  • trunk/src/bp-templates/bp-nouveau/includes/activity/ajax.php

    r13442 r13503  
    115115
    116116                        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' ) ) );
    125118
    126119                                $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  
    220220                        )
    221221                );
    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' );
    226223
    227224                // If the user has favorite create a nav item
    228225                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 
    231226                        $nav_items['favorites'] = array(
    232227                                'component' => 'activity',
    233228                                'slug'      => 'favorites', // slug is used because BP_Core_Nav requires it, but it's the scope
    234229                                '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' ) ) ),
    236231                                'text'      => __( 'My Favorites', 'buddypress' ),
    237232                                'count'     => false,
     
    242237                // The friends component is active and user has friends
    243238                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 
    247239                        $nav_items['friends'] = array(
    248240                                'component' => 'activity',
    249241                                'slug'      => 'friends', // slug is used because BP_Core_Nav requires it, but it's the scope
    250242                                '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' ) ) ) ),
    252244                                'text'      => __( 'My Friends', 'buddypress' ),
    253245                                'count'     => '',
     
    258250                // The groups component is active and user has groups
    259251                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 
    263252                        $nav_items['groups'] = array(
    264253                                'component' => 'activity',
    265254                                'slug'      => 'groups', // slug is used because BP_Core_Nav requires it, but it's the scope
    266255                                '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' ) ) ) ),
    268257                                'text'      => __( 'My Groups', 'buddypress' ),
    269258                                'count'     => '',
     
    274263                // Mentions are allowed
    275264                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
    280268                        if ( bp_get_total_mention_count_for_user( bp_loggedin_user_id() ) ) {
    281269                                $count = bp_get_total_mention_count_for_user( bp_loggedin_user_id() );
     
    286274                                'slug'      => 'mentions', // slug is used because BP_Core_Nav requires it, but it's the scope
    287275                                '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' ) ) ),
    289277                                'text'      => __( 'Mentions', 'buddypress' ),
    290278                                'count'     => $count,
  • trunk/src/bp-templates/bp-nouveau/includes/ajax.php

    r13442 r13503  
    5454                }
    5555
    56                 $activity_slug        = bp_nouveau_get_component_slug( 'activity' );
    57                 $custom_activity_slug = bp_rewrites_get_slug( 'members', 'member_' . $activity_slug, $activity_slug );
    58 
    5956                // We need to calculate and return the feed URL for each scope.
    6057                switch ( $scope ) {
    6158                        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' ) ) ) );
    6960                                break;
    7061                        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' ) ) ) );
    7863                                break;
    7964                        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' ) ) ) );
    8766                                break;
    8867                        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' ) ) ) );
    9669
    9770                                // Get user new mentions
  • trunk/src/bp-templates/bp-nouveau/includes/blogs/functions.php

    r13461 r13503  
    2828        if ( is_user_logged_in() ) {
    2929                $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                 );
    3430
    3531                // If the user has blogs create a nav item
     
    3935                                'slug'      => 'personal', // slug is used because BP_Core_Nav requires it, but it's the scope
    4036                                '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' ) ) ) ),
    4238                                'text'      => __( 'My Sites', 'buddypress' ),
    4339                                'count'     => $my_blogs_count,
  • trunk/src/bp-templates/bp-nouveau/includes/groups/functions.php

    r13472 r13503  
    464464                'id'     => 'my-account-' . buddypress()->settings->id . '-invites',
    465465                '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' ) ) ),
    472467        );
    473468
     
    568563        if ( is_user_logged_in() ) {
    569564                $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                 );
    574565
    575566                // If the user has groups create a nav item
    576567                if ( $my_groups_count ) {
    577                         $path_chunks['single_item_action'] = bp_rewrites_get_slug( 'members', 'member_' . $groups_slug . '_my_groups', 'my-groups' );
    578 
    579568                        $nav_items['personal'] = array(
    580569                                'component' => 'groups',
    581570                                'slug'      => 'personal', // slug is used because BP_Core_Nav requires it, but it's the scope
    582571                                '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' ) ) ),
    584573                                'text'      => __( 'My Groups', 'buddypress' ),
    585574                                'count'     => $my_groups_count,
  • trunk/src/bp-templates/bp-nouveau/includes/members/functions.php

    r13442 r13503  
    7878                // If friends component is active and the user has friends
    7979                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 
    8680                        $nav_items['personal'] = array(
    8781                                'component' => 'members',
    8882                                'slug'      => 'personal', // slug is used because BP_Core_Nav requires it, but it's the scope
    8983                                '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' ) ) ),
    9185                                'text'      => __( 'My Friends', 'buddypress' ),
    9286                                'count'     => bp_get_total_friend_count( bp_loggedin_user_id() ),
  • trunk/src/bp-xprofile/bp-xprofile-activity.php

    r13433 r13503  
    5858        $profile_link = bp_members_get_user_url(
    5959                $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() ) )
    6361        );
    6462
     
    255253        $profile_link = bp_members_get_user_url(
    256254                $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() ) )
    260256        );
    261257
  • trunk/src/bp-xprofile/bp-xprofile-template.php

    r13484 r13503  
    408408
    409409                // 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 ) ) ) );
    417411
    418412                /**
     
    11291123
    11301124                // 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 ) ) ) );
    11381126
    11391127                // Add tab to end of tabs array.
     
    12931281 */
    12941282function 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 
    13011283        bp_button( array(
    13021284                'id'                => 'edit_profile',
     
    13041286                'must_be_logged_in' => true,
    13051287                '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' ) ) ),
    13071289                'link_class'        => 'edit',
    13081290                'link_text'         => __( 'Edit Profile', 'buddypress' ),
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-component.php

    r13495 r13503  
    289289                if ( is_user_logged_in() ) {
    290290                        $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                         );
    294291
    295292                        // Add the "Profile" sub menu.
     
    298295                                'id'     => 'my-account-' . $this->id,
    299296                                '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 ) ) ),
    301298                        );
    302 
    303                         $path_chunks['single_item_action'] = bp_rewrites_get_slug( 'members', 'member_' . $profile_slug . '_public', 'public' );
    304299
    305300                        // View Profile.
     
    308303                                'id'       => 'my-account-' . $this->id . '-public',
    309304                                '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' ) ) ),
    311306                                'position' => 10,
    312307                        );
    313 
    314                         $path_chunks['single_item_action'] = bp_rewrites_get_slug( 'members', 'member_' . $profile_slug . '_edit', 'edit' );
    315308
    316309                        // Edit Profile.
     
    319312                                'id'       => 'my-account-' . $this->id . '-edit',
    320313                                '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' ) ) ),
    322315                                'position' => 20,
    323316                        );
     
    392385         */
    393386        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 
    402387                // Add the "Profile" subnav item.
    403388                $wp_admin_nav[] = array(
     
    405390                        'id'     => 'my-account-' . buddypress()->settings->id . '-profile',
    406391                        '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' ) ) ),
    408393                );
    409394
  • trunk/src/bp-xprofile/screens/edit.php

    r13468 r13503  
    2121        }
    2222
    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 
    3023        // Make sure a group is set.
    3124        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                );
    3428        }
    3529
     
    4135
    4236        // No errors.
    43         $errors = false;
     37        $errors      = false;
     38        $path_chunks = array( bp_get_profile_slug(), 'edit' );
    4439
    4540        // Check to see if any new information has been submitted.
     
    5146                // Check we have field ID's.
    5247                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 ) ) );
    5550                }
    5651
     
    165160
    166161                        // 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 ) ) );
    169164                }
    170165        }
  • trunk/src/bp-xprofile/screens/settings-profile.php

    r13443 r13503  
    110110        do_action( 'bp_xprofile_settings_after_save' );
    111111
    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' ) ) )
    117115        );
    118         bp_core_redirect( bp_displayed_user_url( $path_chunks ) );
    119116}
    120117add_action( 'bp_actions', 'bp_xprofile_action_settings' );
  • trunk/tests/phpunit/testcases/groups/template.php

    r13437 r13503  
    10061006        public function test_bp_bp_get_group_form_action() {
    10071007                $g   = $this->factory->group->create();
    1008                 $p   = 2;
     1008                $p   = 'members';
    10091009                $url = bp_get_group_url(
    10101010                        $g,
Note: See TracChangeset for help on using the changeset viewer.