Skip to:
Content

BuddyPress.org

Changeset 13683


Ignore:
Timestamp:
12/29/2023 11:05:38 AM (10 months ago)
Author:
imath
Message:

Make sure Edit Photo / Cover image slugs can be customized

Wait for the navigation to be fully set before eventually moving the Member's profile sub nav items into the Member's xProfile sub nav. This make sure the slugs to edit profile photo and cover image can be customized when the BP root site is not the same than the main site of a network on multisite configurations.

Fixes #9050 (branch 12.0)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/12.0/src/bp-core/bp-core-functions.php

    r13679 r13683  
    49924992
    49934993        if ( isset( $component->sub_nav ) && is_array( $component->sub_nav ) && $component->sub_nav ) {
    4994             // We possibly need to move some members nav items.
    4995             if ( 'members' === $key_component && isset( $navigations['profile']['sub_nav'] ) ) {
    4996                 $profile_subnav_slugs = wp_list_pluck( $navigations['profile']['sub_nav'], 'slug' );
    4997                 foreach ( $component->sub_nav as $members_subnav ) {
    4998                     if ( 'profile' === $members_subnav['parent_slug'] && ! in_array( $members_subnav['slug'], $profile_subnav_slugs, true ) ) {
    4999                         $navigations['profile']['sub_nav'][] = $members_subnav;
    5000                     }
    5001                 }
     4994            $navigations[ $key_component ]['sub_nav'] = $component->sub_nav;
     4995        }
     4996    }
     4997
     4998    // We possibly need to move some members nav items.
     4999    if ( isset( $navigations['members']['sub_nav'], $navigations['profile']['sub_nav'] ) ) {
     5000        $profile_subnav_slugs = wp_list_pluck( $navigations['profile']['sub_nav'], 'slug' );
     5001
     5002        foreach ( $navigations['members']['sub_nav'] as $members_subnav ) {
     5003            if ( 'profile' === $members_subnav['parent_slug'] && ! in_array( $members_subnav['slug'], $profile_subnav_slugs, true ) ) {
     5004                $navigations['profile']['sub_nav'][] = $members_subnav;
    50025005            }
    5003 
    5004             $navigations[ $key_component ]['sub_nav'] = $component->sub_nav;
    50055006        }
    50065007    }
Note: See TracChangeset for help on using the changeset viewer.