months_dropdown_results

Filters the 'Months' drop-down results.

Description

apply_filters( 'months_dropdown_results', (object) $months, (string) $post_type ); 

Parameters (2)

0. $months (object)
The months drop-down query results.
1. $post_type (string)
The post type.

Usage

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

Defined (1)

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

/wp-admin/includes/class-wp-list-table.php  
  1. $months = apply_filters( 'months_dropdown_results', $months, $post_type );