Skip to:
Content

BuddyPress.org

Changeset 13472


Ignore:
Timestamp:
05/07/2023 05:40:25 PM (10 months ago)
Author:
imath
Message:

Use the bp_displayed_user_url() function the right way

Use the bp_members_get_path_chunks() helper function to build the arguments array expected by bp_displayed_user_url() at 8 places where a regular array of slugs were wrongly used during the BP Rewrites merge process (#4954).

Closes https://github.com/buddypress/buddypress/pull/98
Fixes #8884

Location:
trunk/src/bp-templates
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-legacy/buddypress/members/single/settings/data.php

    r13443 r13472  
    8585                sprintf(
    8686                    '<a href="%1$s">%2$s</a>',
    87                     esc_url( bp_displayed_user_url( array( bp_get_settings_slug(), 'delete-account' ) ) ),
     87                    esc_url( bp_displayed_user_url( bp_members_get_path_chunks( array( bp_get_settings_slug(), 'delete-account'  ) ) ) ),
    8888                    esc_html__( 'Delete Account', 'buddypress' )
    8989                )
  • trunk/src/bp-templates/bp-nouveau/buddypress/members/single/settings/data.php

    r13443 r13472  
    7878                sprintf(
    7979                    '<a href="%1$s">%2$s</a>',
    80                     esc_url( bp_displayed_user_url( array( bp_nouveau_get_component_slug( 'settings' ), 'delete-account' ) ) ),
     80                    esc_url( bp_displayed_user_url( bp_members_get_path_chunks( array( bp_nouveau_get_component_slug( 'settings' ), 'delete-account' ) ) ) ),
    8181                    esc_html__( 'Delete Account', 'buddypress' )
    8282                )
  • trunk/src/bp-templates/bp-nouveau/includes/groups/functions.php

    r13461 r13472  
    503503        }
    504504
    505         bp_core_redirect( bp_displayed_user_url( array( bp_nouveau_get_component_slug( 'settings' ), 'invites' ) ) );
     505        bp_core_redirect( bp_displayed_user_url( bp_members_get_path_chunks( array( bp_nouveau_get_component_slug( 'settings' ), 'invites' ) ) ) );
    506506    }
    507507
  • trunk/src/bp-templates/bp-nouveau/includes/template-tags.php

    r13471 r13472  
    27142714
    27152715                if ( $retval ) {
    2716                     $bp_nouveau->activity->current_rss_feed['link'] = bp_displayed_user_url( array( bp_nouveau_get_component_slug( 'activity' ), 'feed' ) );
     2716                    $bp_nouveau->activity->current_rss_feed['link'] = bp_displayed_user_url( bp_members_get_path_chunks( array( bp_nouveau_get_component_slug( 'activity' ), 'feed' ) ) );
    27172717                }
    27182718
     
    27212721
    27222722                    if ( $retval ) {
    2723                         $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' ) );
     2723                        $bp_nouveau->activity->current_rss_feed['link'] = bp_displayed_user_url( bp_members_get_path_chunks( array( bp_nouveau_get_component_slug( 'activity' ), bp_nouveau_get_component_slug( 'friends' ), 'feed' ) ) );
    27242724                    }
    27252725                } elseif ( bp_is_active( 'groups' ) && bp_is_current_action( bp_nouveau_get_component_slug( 'groups' ) ) ) {
     
    27272727
    27282728                    if ( $retval ) {
    2729                         $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' ) );
     2729                        $bp_nouveau->activity->current_rss_feed['link'] = bp_displayed_user_url( bp_members_get_path_chunks( array( bp_nouveau_get_component_slug( 'activity' ), bp_nouveau_get_component_slug( 'groups' ), 'feed' ) ) );
    27302730                    }
    27312731                } elseif ( bp_activity_do_mentions() && bp_is_current_action( 'mentions' ) ) {
     
    27332733
    27342734                    if ( $retval ) {
    2735                         $bp_nouveau->activity->current_rss_feed['link'] = bp_displayed_user_url( array( bp_nouveau_get_component_slug( 'activity' ), 'mentions', 'feed' ) );
     2735                        $bp_nouveau->activity->current_rss_feed['link'] = bp_displayed_user_url( bp_members_get_path_chunks( array( bp_nouveau_get_component_slug( 'activity' ), 'mentions', 'feed' ) ) );
    27362736                    }
    27372737                } elseif ( bp_activity_can_favorite() && bp_is_current_action( 'favorites' ) ) {
     
    27392739
    27402740                    if ( $retval ) {
    2741                         $bp_nouveau->activity->current_rss_feed['link'] = bp_displayed_user_url( array( bp_nouveau_get_component_slug( 'activity' ), 'favorites', 'feed' ) );
     2741                        $bp_nouveau->activity->current_rss_feed['link'] = bp_displayed_user_url( bp_members_get_path_chunks( array( bp_nouveau_get_component_slug( 'activity' ), 'favorites', 'feed' ) ) );
    27422742                    }
    27432743                }
Note: See TracChangeset for help on using the changeset viewer.