disable_months_dropdown
Filters whether to remove the 'Months' drop-down from the post list table.
Usage
add_filter( 'disable_months_dropdown', 'wp_kama_disable_months_dropdown_filter', 10, 2 ); /** * Function for `disable_months_dropdown` filter-hook. * * @param bool $disable Whether to disable the drop-down. * @param string $post_type The post type. * * @return bool */ function wp_kama_disable_months_dropdown_filter( $disable, $post_type ){ // filter... return $disable; }
- $disable(true|false)
- Whether to disable the drop-down.
Default: false - $post_type(string)
- The post type.
Changelog
Since 4.2.0 | Introduced. |
Where the hook is called
wp-admin/includes/class-wp-list-table.php 677
if ( apply_filters( 'disable_months_dropdown', false, $post_type ) ) {