Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/18/2023 04:11:04 AM (2 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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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' );
Note: See TracChangeset for help on using the changeset viewer.