page_attributes_dropdown_pages_args

Filters the arguments used to generate a Pages drop-down element.

Description

apply_filters( 'page_attributes_dropdown_pages_args', (array) $dropdown_args, (WP_Post) $post ); 

Parameters (2)

0. $dropdown_args (array)
Array of arguments used to generate the pages drop-down.
1. $post (WP_Post)
The current WP_Post object.

Usage

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

Defined (1)

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

/wp-admin/includes/meta-boxes.php  
  1. $dropdown_args = apply_filters( 'page_attributes_dropdown_pages_args', $dropdown_args, $post );