Skip to:
Content

BuddyPress.org

Ticket #5103: 5103.patch

File 5103.patch, 731 bytes (added by imath, 11 years ago)
  • src/bp-core/bp-core-buddybar.php

    diff --git src/bp-core/bp-core-buddybar.php src/bp-core/bp-core-buddybar.php
    index a854fd3..a3f40a1 100644
    function bp_core_new_subnav_item( $args = '' ) { 
    295295        if ( empty( $item_css_id ) )
    296296                $item_css_id = $slug;
    297297
     298        // In case of a single group, if the parent url doesn't concern the groups component,
     299        // don't create the submenu
     300        if ( bp_is_group() && bp_is_active( 'groups' ) ) {
     301
     302                $groups_root_slug = bp_get_groups_root_slug();
     303
     304                if ( ! preg_match( "/$groups_root_slug/", $parent_url ) ) {
     305                        return false;
     306                }
     307        }
     308
    298309        $subnav_item = array(
    299310                'name'            => $name,
    300311                'link'            => trailingslashit( $link ),