Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/31/2023 05:26:39 PM (2 years ago)
Author:
imath
Message:

Make sure all displayed user URLs are built using the BP Rewrites API

Replace all remaining bp_displayed_user_domain() usage in favor of
bp_displayed_user_url().
Introduce the bp_members_get_path_chunks() function to quickly build BP
Rewrites argument for member's URL using an array of slugs.
Deprecate bp_activities_member_rss_link(), bp_blogs_blog_tabs() &
bp_groups_header_tabs().
Improve bp_displayed_user_link() so that it's possible to pass an array
of slugs to output an escaped BP Rewrites ready URL.

Props r-a-y, johnjamesjacoby, boonebgorges

Closes https://github.com/buddypress/buddypress/pull/79
See #4954

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-messages/actions/star.php

    r13096 r13443  
    3939
    4040    // Redirect back to previous screen.
    41     $redirect = wp_get_referer() ? wp_get_referer() : bp_displayed_user_domain() . bp_get_messages_slug();
     41    $redirect = wp_get_referer();
     42
     43    if ( ! $redirect ) {
     44        $messages_slug = bp_get_messages_slug();
     45        $redirect      = bp_displayed_user_url(
     46            array(
     47                'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $messages_slug, $messages_slug ),
     48            )
     49        );
     50    }
     51
    4252    bp_core_redirect( $redirect );
    4353    die();
Note: See TracChangeset for help on using the changeset viewer.