Filter hook 'wp_list_table_show_post_checkbox'

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

View Source

wp_list_table_show_post_checkbox

Filter Hook
Description
Filters whether to show the bulk edit checkbox for a post in its list table. By default the checkbox is only shown if the current user can edit the post.

Hook Information

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

Hook Parameters

Type Name Description
bool $show Whether to show the checkbox.
WP_Post $post The current WP_Post object.

Usage Examples

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

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

Source Code Context

wp-admin/includes/class-wp-posts-list-table.php:1040 - How this hook is used in WordPress core
<?php
1035  		 * @since 5.7.0
1036  		 *
1037  		 * @param bool    $show Whether to show the checkbox.
1038  		 * @param WP_Post $post The current WP_Post object.
1039  		 */
1040  		if ( apply_filters( 'wp_list_table_show_post_checkbox', $show, $post ) ) :
1041  			?>
1042  			<input id="cb-select-<?php the_ID(); ?>" type="checkbox" name="post[]" value="<?php the_ID(); ?>" />
1043  			<label for="cb-select-<?php the_ID(); ?>">
1044  				<span class="screen-reader-text">
1045  				<?php

PHP Documentation

<?php
/**
		 * Filters whether to show the bulk edit checkbox for a post in its list table.
		 *
		 * By default the checkbox is only shown if the current user can edit the post.
		 *
		 * @since 5.7.0
		 *
		 * @param bool    $show Whether to show the checkbox.
		 * @param WP_Post $post The current WP_Post object.
		 */
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.