Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/10/2016 02:53:53 PM (8 years ago)
Author:
boonebgorges
Message:

Fix syntax error in back compat block of bp_core_remove_subnav_item().

The arguments were reversed, causing a compatibility break with plugins
using bp_core_remove_subnav_item() to remove group nav items.

We simplify the logic by setting $component to 'groups' in thes cases, and
letting the rest of the function handle the nav removal.

To maintain the parallel construction, a similar syntax change has been
introduced to bp_core_remove_nav_item().

Props dcavins, imath.
Fixes #6534.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-buddybar.php

    r10825 r10876  
    784784    if ( ! $component && bp_is_active( 'groups' ) && isset( $bp->groups->nav ) ) {
    785785        if ( $bp->groups->nav->get_primary( array( 'slug' => $slug ) ) ) {
    786             return bp_core_remove_nav_item( $slug, 'groups' );
     786            $component = 'groups';
    787787        }
    788788    }
     
    835835    if ( ! $component && bp_is_active( 'groups' ) && isset( $bp->groups->nav ) ) {
    836836        if ( $bp->groups->nav->get_primary( array( 'slug' => $parent_slug ) ) ) {
    837             return bp_core_remove_subnav_item( $slug, $parent_slug, 'groups' );
     837            $component = 'groups';
    838838        }
    839839    }
Note: See TracChangeset for help on using the changeset viewer.