bp_core_exclude_pages

Prevent specific pages (eg 'Activate') from showing on page listings.

Description

(array) bp_core_exclude_pages( (array) $pages = array() ); 

Returns (array)

The exclude list, with BP's pages added.

Parameters (1)

0. $pages — Optional. (array) => array()
List of excluded page IDs, as passed to the wp_list_pages_excludes filter.

Usage

  1. if ( !function_exists( 'bp_core_exclude_pages' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/bp-core-filters.php'; 
  3.  
  4. // List of excluded page IDs, as passed to the 
  5. // 'wp_list_pages_excludes' filter. 
  6. $pages = array(); 
  7.  
  8. // NOTICE! Understand what this does before running. 
  9. $result = bp_core_exclude_pages($pages); 
  10.  

Defined (1)

The function is defined in the following location(s).

/bp-core/bp-core-filters.php  
  1. function bp_core_exclude_pages( $pages = array() ) { 
  2.  
  3. // Bail if not the root blog. 
  4. if ( ! bp_is_root_blog() ) 
  5. return $pages; 
  6.  
  7. $bp =buddypress); 
  8.  
  9. if ( !empty( $bp->pages->activate ) ) 
  10. $pages[] = $bp->pages->activate->id; 
  11.  
  12. if ( !empty( $bp->pages->register ) ) 
  13. $pages[] = $bp->pages->register->id; 
  14.  
  15. if ( !empty( $bp->pages->forums ) && ( !bp_is_active( 'forums' ) || ( bp_is_active( 'forums' ) && bp_forums_has_directory() && !bp_forums_is_installed_correctly() ) ) ) 
  16. $pages[] = $bp->pages->forums->id; 
  17.  
  18. /** 
  19. * Filters specific pages that shouldn't show up on page listings. 
  20. * @since 1.5.0 
  21. * @param array $pages Array of pages to exclude. 
  22. */