wp_list_pages_excludes

Filters the array of pages to exclude from the pages list.

Description

apply_filters( 'wp_list_pages_excludes', (array) $exclude_array ); 

Parameters (1)

0. $exclude_array (array)
An array of page IDs to exclude.

Usage

To run the hook, copy the example below.
  1. $exclude_array = apply_filters( 'wp_list_pages_excludes', $exclude_array ); 
  2.  
  3. if ( !empty( $exclude_array ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the wp_list_pages_excludes callback 
  2. function filter_wp_list_pages_excludes( $exclude_array ) { 
  3. // make filter magic happen here... 
  4. return $exclude_array
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'wp_list_pages_excludes', 'filter_wp_list_pages_excludes', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'wp_list_pages_excludes', 'filter_wp_list_pages_excludes', 10, 1 ); 

Defined (1)

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

/wp-includes/post-template.php  
  1. $r['exclude'] = implode( ', ', apply_filters( 'wp_list_pages_excludes', $exclude_array ) );