Filter hook 'disable_months_dropdown'

in WP Core File wp-admin/includes/class-wp-list-table.php at line 716

View Source

disable_months_dropdown

Filter Hook
Description
Filters whether to remove the 'Months' drop-down from the post list table.

Hook Information

File Location wp-admin/includes/class-wp-list-table.php View on GitHub
Hook Type Filter
Line Number 716

Hook Parameters

Type Name Description
bool $disable Whether to disable the drop-down. Default false.
string $post_type The post type.

Usage Examples

Basic Usage
<?php
// Hook into disable_months_dropdown
add_filter('disable_months_dropdown', 'my_custom_filter', 10, 2);

function my_custom_filter($disable, $post_type) {
    // Your custom filtering logic here
    return $disable;
}

Source Code Context

wp-admin/includes/class-wp-list-table.php:716 - How this hook is used in WordPress core
<?php
 711  		 * @since 4.2.0
 712  		 *
 713  		 * @param bool   $disable   Whether to disable the drop-down. Default false.
 714  		 * @param string $post_type The post type.
 715  		 */
 716  		if ( apply_filters( 'disable_months_dropdown', false, $post_type ) ) {
 717  			return;
 718  		}
 719  
 720  		/**
 721  		 * Filters whether to short-circuit performing the months dropdown query.

PHP Documentation

<?php
/**
		 * Filters whether to remove the 'Months' drop-down from the post list table.
		 *
		 * @since 4.2.0
		 *
		 * @param bool   $disable   Whether to disable the drop-down. Default false.
		 * @param string $post_type The post type.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-admin/includes/class-wp-list-table.php
Related Hooks

Related hooks will be displayed here in future updates.