Filter hook 'quick_edit_enabled_for_post_type'

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

View Source

quick_edit_enabled_for_post_type

Filter Hook
Description
Filters whether Quick Edit should be enabled for the given post type.

Hook Information

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

Hook Parameters

Type Name Description
bool $enable Whether to enable the Quick Edit functionality. Default true.
string $post_type Post type name.

Usage Examples

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

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

Source Code Context

wp-admin/includes/class-wp-posts-list-table.php:1503 - How this hook is used in WordPress core
<?php
1498  			 * @since 6.4.0
1499  			 *
1500  			 * @param bool   $enable    Whether to enable the Quick Edit functionality. Default true.
1501  			 * @param string $post_type Post type name.
1502  			 */
1503  			$quick_edit_enabled = apply_filters( 'quick_edit_enabled_for_post_type', true, $post->post_type );
1504  
1505  			if ( $quick_edit_enabled && 'wp_block' !== $post->post_type ) {
1506  				$actions['inline hide-if-no-js'] = sprintf(
1507  					'<button type="button" class="button-link editinline" aria-label="%s" aria-expanded="false">%s</button>',
1508  					/* translators: %s: Post title. */

PHP Documentation

<?php
/**
			 * Filters whether Quick Edit should be enabled for the given post type.
			 *
			 * @since 6.4.0
			 *
			 * @param bool   $enable    Whether to enable the Quick Edit functionality. Default true.
			 * @param string $post_type Post type name.
			 */
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.