Skip to:
Content

BuddyPress.org

Changeset 13978


Ignore:
Timestamp:
07/27/2024 03:10:45 PM (10 months ago)
Author:
imath
Message:

Use the right parent page to generate the BP Admin Profile URL

Make sure this parent page is always profile.php when a subscriber is viewing their WP Admin/Extended profile.

Fixes #9219
Closes https://github.com/buddypress/buddypress/pull/353

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-members/classes/class-bp-members-admin.php

    r13976 r13978  
    763763        // Editing your own profile, so recheck some vars.
    764764        if ( true === $this->is_self_profile ) {
    765 
    766765            // Use profile.php as the edit page.
    767766            $edit_page = 'profile.php';
     
    778777        }
    779778
     779        $this->edit_profile_url = add_query_arg( $this->edit_profile_args, admin_url( $edit_page ) );
     780        $this->edit_url         = admin_url( $edit_page );
     781
    780782        if ( is_user_admin() ) {
    781783            $this->edit_profile_url = add_query_arg( $this->edit_profile_args, user_admin_url( 'profile.php' ) );
    782784            $this->edit_url         = user_admin_url( 'profile.php' );
    783785
    784         } elseif ( is_blog_admin() ) {
     786            // On a blog of a network, Extended Profile URL needs to rely on the users.php one for the blog Admin.
     787        } elseif ( is_blog_admin() && current_user_can( 'remove_users' ) ) {
    785788            $this->edit_profile_url = add_query_arg( $this->edit_profile_args, admin_url( 'users.php' ) );
    786789            $this->edit_url         = admin_url( $edit_page );
Note: See TracChangeset for help on using the changeset viewer.