Filter hook 'disable_categories_dropdown'

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

View Source

disable_categories_dropdown

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

Hook Information

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

Hook Parameters

Type Name Description
bool $disable Whether to disable the categories drop-down. Default false.
string $post_type Post type slug.

Usage Examples

Basic Usage
<?php
// Hook into disable_categories_dropdown
add_filter('disable_categories_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-posts-list-table.php:475 - How this hook is used in WordPress core
<?php
 470  		 * @since 4.6.0
 471  		 *
 472  		 * @param bool   $disable   Whether to disable the categories drop-down. Default false.
 473  		 * @param string $post_type Post type slug.
 474  		 */
 475  		if ( false !== apply_filters( 'disable_categories_dropdown', false, $post_type ) ) {
 476  			return;
 477  		}
 478  
 479  		if ( is_object_in_taxonomy( $post_type, 'category' ) ) {
 480  			$dropdown_options = array(

PHP Documentation

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

Related hooks will be displayed here in future updates.