Changeset 8033 for trunk/bp-core/bp-core-filters.php
- Timestamp:
- 03/04/2014 04:23:03 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/bp-core/bp-core-filters.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-filters.php
r7945 r8033 103 103 * 104 104 * @since BuddyPress (2.0.0) 105 * 105 * 106 106 * @uses bp_is_root_blog() checks if current blog is root blog. 107 107 * @uses buddypress() gets BuddyPress main instance … … 112 112 function bp_core_exclude_pages_from_nav_menu_admin( $object = null ) { 113 113 114 // Bail if not the root blog 115 if ( ! bp_is_root_blog() ) 116 return $object; 117 118 if ( 'page' != $object->name ) 119 return $object; 120 121 $bp = buddypress(); 122 $pages = array(); 123 124 if ( ! empty( $bp->pages->activate ) ) 125 $pages[] = $bp->pages->activate->id; 126 127 if ( ! empty( $bp->pages->register ) ) 128 $pages[] = $bp->pages->register->id; 129 130 if ( ! empty( $pages ) ) 131 $object->_default_query['post__not_in'] = $pages; 132 133 return $object; 114 // Bail if not the root blog 115 if ( ! bp_is_root_blog() ) { 116 return $object; 117 } 118 119 if ( 'page' != $object->name ) { 120 return $object; 121 } 122 123 $bp = buddypress(); 124 $pages = array(); 125 126 if ( ! empty( $bp->pages->activate ) ) { 127 $pages[] = $bp->pages->activate->id; 128 } 129 130 if ( ! empty( $bp->pages->register ) ) { 131 $pages[] = $bp->pages->register->id; 132 } 133 134 if ( ! empty( $pages ) ) { 135 $object->_default_query['post__not_in'] = $pages; 136 } 137 138 return $object; 134 139 } 135 140 add_filter( 'nav_menu_meta_box_object', 'bp_core_exclude_pages_from_nav_menu_admin', 11, 1 );
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)