Skip to:
Content

BuddyPress.org

Ticket #6694: 6694.01.patch

File 6694.01.patch, 805 bytes (added by dcavins, 4 years ago)

In bp_core_set_uri_globals() add a filter for $after_member_slug, the portion of the URI immediately following /members/.

  • src/bp-core/bp-core-catchuri.php

    diff --git src/bp-core/bp-core-catchuri.php src/bp-core/bp-core-catchuri.php
    index ada5bf9..a1d58bd 100644
    function bp_core_set_uri_globals() { 
    272272
    273273                        // Are we viewing a specific user?
    274274                        if ( $after_member_slug ) {
     275
     276                                /*
     277                                 * Filter the portion of the URI immediately following 'members'.
     278                                 *
     279                                 * @since 2.6.0
     280                                 *
     281                                 * @param string $after_member_slug The portion of the URI immediately following 'members'.
     282                                 */
     283                                $after_member_slug = apply_filters( 'bp_core_set_uri_globals_after_member_slug', $after_member_slug );
     284
    275285                                // If root profile, we've already queried for the user.
    276286                                if ( $root_profile instanceof WP_User ) {
    277287                                        $bp->displayed_user->id = $root_profile->ID;