Skip to:
Content

BuddyPress.org

Ticket #6534: 6534.set-component-instead.patch

File 6534.set-component-instead.patch, 1.0 KB (added by dcavins, 7 years ago)

In the 'groups' backcopat case for bp_core_remove_nav_item() and bp_core_remove_subnav_item(), set the component and continue.

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

    diff --git src/bp-core/bp-core-buddybar.php src/bp-core/bp-core-buddybar.php
    index f16557f..95b3f63 100644
    function bp_core_remove_nav_item( $slug, $component = null ) { 
    783783        // Backward compatibility for removing group nav items using the group slug as `$parent_slug`.
    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        }
    789789
    function bp_core_remove_subnav_item( $parent_slug, $slug, $component = null ) { 
    834834        // Backward compatibility for removing group nav items using the group slug as `$parent_slug`.
    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        }
    840840