Comments: Introduce filter for the arguments for the comment query in the comments list table.
Add `comments_list_table_query_args` filter to the Comments List Table. Props soulseekah, birgire. Fixes #42997. git-svn-id: https://develop.svn.wordpress.org/trunk@42420 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
581b74cbed
commit
7567f588b3
|
@ -134,6 +134,15 @@ class WP_Comments_List_Table extends WP_List_Table {
|
||||||
'post_type' => $post_type,
|
'post_type' => $post_type,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filters the arguments for the comment query in the comments list table.
|
||||||
|
*
|
||||||
|
* @since 5.0.0
|
||||||
|
*
|
||||||
|
* @param array $args An array of get_comments() arguments.
|
||||||
|
*/
|
||||||
|
$args = apply_filters( 'comments_list_table_query_args', $args );
|
||||||
|
|
||||||
$_comments = get_comments( $args );
|
$_comments = get_comments( $args );
|
||||||
if ( is_array( $_comments ) ) {
|
if ( is_array( $_comments ) ) {
|
||||||
update_comment_cache( $_comments );
|
update_comment_cache( $_comments );
|
||||||
|
|
Loading…
Reference in New Issue