get_page_of_comment_query_args
Filters the arguments used to query comments in get_page_of_comment().
Использование
add_filter( 'get_page_of_comment_query_args', 'wp_kama_get_page_of_comment_query_args_filter' ); /** * Function for `get_page_of_comment_query_args` filter-hook. * * @param array $comment_args Array of WP_Comment_Query arguments. * * @return array */ function wp_kama_get_page_of_comment_query_args_filter( $comment_args ){ // filter... return $comment_args; }
- $comment_args(массив)
Array of WP_Comment_Query arguments.
-
type(строка)
Limit paginated comments to those matching a given type. Accepts 'comment', 'trackback', 'pingback', 'pings' (trackbacks and pingbacks), or 'all'.
По умолчанию: 'all' -
post_id(int)
ID of the post. -
fields(строка)
Comment fields to return. -
count(true|false)
Whether to return a comment count (true) or array of comment objects (false). -
status(строка)
Comment status. -
parent(int)
Parent ID of comment to retrieve children of. -
date_query(массив)
Date query clauses to limit comments by. See WP_Date_Query. - include_unapproved(массив)
Array of IDs or email addresses whose unapproved comments will be included in paginated comments.
-
Список изменений
С версии 5.5.0 | Введена. |
Где вызывается хук
get_page_of_comment_query_args
wp-includes/comment.php 1163
$comment_args = apply_filters( 'get_page_of_comment_query_args', $comment_args );