Filter hook 'comments_list_table_query_args'

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

View Source

comments_list_table_query_args

Filter Hook
Description
Filters the arguments for the comment query in the comments list table.

Hook Information

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

Hook Parameters

Type Name Description
array $args An array of get_comments() arguments.

Usage Examples

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

function my_custom_filter($args) {
    // Your custom filtering logic here
    return $args;
}

Source Code Context

wp-admin/includes/class-wp-comments-list-table.php:163 - How this hook is used in WordPress core
<?php
 158  		 *
 159  		 * @since 5.1.0
 160  		 *
 161  		 * @param array $args An array of get_comments() arguments.
 162  		 */
 163  		$args = apply_filters( 'comments_list_table_query_args', $args );
 164  
 165  		$_comments = get_comments( $args );
 166  
 167  		if ( is_array( $_comments ) ) {
 168  			$this->items       = array_slice( $_comments, 0, $comments_per_page );

PHP Documentation

<?php
/**
		 * Filters the arguments for the comment query in the comments list table.
		 *
		 * @since 5.1.0
		 *
		 * @param array $args An array of get_comments() arguments.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-admin/includes/class-wp-comments-list-table.php
Related Hooks

Related hooks will be displayed here in future updates.