Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/31/2023 05:26:39 PM (18 months 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-templates/bp-nouveau/includes/template-tags.php

    r13441 r13443  
    22592259
    22602260    if ( bp_is_user() ) {
    2261         $url = rawurlencode( bp_displayed_user_domain() );
     2261        $url = rawurlencode( bp_displayed_user_url() );
    22622262
    22632263    } elseif ( bp_is_group() ) {
     
    26992699
    27002700                if ( $retval ) {
    2701                     $bp_nouveau->activity->current_rss_feed['link'] = trailingslashit( bp_displayed_user_domain() . bp_nouveau_get_component_slug( 'activity' ) . '/feed' );
     2701                    $bp_nouveau->activity->current_rss_feed['link'] = bp_displayed_user_url( array( bp_nouveau_get_component_slug( 'activity' ), 'feed' ) );
    27022702                }
    27032703
     
    27062706
    27072707                    if ( $retval ) {
    2708                         $bp_nouveau->activity->current_rss_feed['link'] = trailingslashit( bp_displayed_user_domain() . bp_nouveau_get_component_slug( 'activity' ) . '/' . bp_nouveau_get_component_slug( 'friends' ) . '/feed' );
     2708                        $bp_nouveau->activity->current_rss_feed['link'] = bp_displayed_user_url( array( bp_nouveau_get_component_slug( 'activity' ), bp_nouveau_get_component_slug( 'friends' ), 'feed' ) );
    27092709                    }
    27102710                } elseif ( bp_is_active( 'groups' ) && bp_is_current_action( bp_nouveau_get_component_slug( 'groups' ) ) ) {
     
    27122712
    27132713                    if ( $retval ) {
    2714                         $bp_nouveau->activity->current_rss_feed['link'] = trailingslashit( bp_displayed_user_domain() . bp_nouveau_get_component_slug( 'activity' ) . '/' . bp_nouveau_get_component_slug( 'groups' ) . '/feed' );
     2714                        $bp_nouveau->activity->current_rss_feed['link'] = bp_displayed_user_url( array( bp_nouveau_get_component_slug( 'activity' ), bp_nouveau_get_component_slug( 'groups' ), 'feed' ) );
    27152715                    }
    27162716                } elseif ( bp_activity_do_mentions() && bp_is_current_action( 'mentions' ) ) {
     
    27182718
    27192719                    if ( $retval ) {
    2720                         $bp_nouveau->activity->current_rss_feed['link'] = trailingslashit( bp_displayed_user_domain() . bp_nouveau_get_component_slug( 'activity' ) . '/mentions/feed' );
     2720                        $bp_nouveau->activity->current_rss_feed['link'] = bp_displayed_user_url( array( bp_nouveau_get_component_slug( 'activity' ), 'mentions', 'feed' ) );
    27212721                    }
    27222722                } elseif ( bp_activity_can_favorite() && bp_is_current_action( 'favorites' ) ) {
     
    27242724
    27252725                    if ( $retval ) {
    2726                         $bp_nouveau->activity->current_rss_feed['link'] = trailingslashit( bp_displayed_user_domain() . bp_nouveau_get_component_slug( 'activity' ) . '/favorites/feed' );
     2726                        $bp_nouveau->activity->current_rss_feed['link'] = bp_displayed_user_url( array( bp_nouveau_get_component_slug( 'activity' ), 'favorites', 'feed' ) );
    27272727                    }
    27282728                }
Note: See TracChangeset for help on using the changeset viewer.