| | 101 | |
| | 102 | function 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 | |
| | 125 | add_filter( 'nav_menu_meta_box_object', 'bp_core_exclude_pages_from_nav_menu_admin', 11, 1 ); |
| | 126 | |