Skip to:
Content

BuddyPress.org

Ticket #5323: 5323.diff

File 5323.diff, 953 bytes (added by imath, 11 years ago)
  • bp-core/bp-core-filters.php

     
    9898}
    9999add_filter( 'wp_list_pages_excludes', 'bp_core_exclude_pages' );
    100100
     101
     102function bp_core_exclude_pages_from_nav_menu_admin( $object = null ) {
     103
     104        // Bail if not the root blog
     105        if ( ! bp_is_root_blog() )
     106                return $object;
     107
     108        if ( 'page' != $object->name )
     109                return $object;
     110
     111        $bp = buddypress();
     112
     113        if ( !empty( $bp->pages->activate ) )
     114                $pages[] = $bp->pages->activate->id;
     115
     116        if ( !empty( $bp->pages->register ) )
     117                $pages[] = $bp->pages->register->id;
     118       
     119        if( !empty( $pages ) )
     120                $object->_default_query['post__not_in'] = $pages;
     121
     122        return $object;
     123}
     124
     125add_filter( 'nav_menu_meta_box_object', 'bp_core_exclude_pages_from_nav_menu_admin', 11, 1 );
     126
    101127/**
    102128 * Set "From" name in outgoing email to the site name.
    103129 *