comments_template_top_level_query_args хук-фильтрWP 5.6.0

Filters the arguments used in the top level comments query.

Использование

add_filter( 'comments_template_top_level_query_args', 'wp_kama_comments_template_top_level_query_args_filter' );

/**
 * Function for `comments_template_top_level_query_args` filter-hook.
 * 
 * @param array $top_level_args The top level query arguments for the comments template.
 *
 * @return array
 */
function wp_kama_comments_template_top_level_query_args_filter( $top_level_args ){

	// filter...
	return $top_level_args;
}
$top_level_args(массив)

The top level query arguments for the comments template.

  • count(true|false)
    Whether to return a comment count.

  • orderby(строка|массив)
    The field(s) to order by.

  • post_id(int)
    The post ID.

  • status(строка|массив)
    The comment status to limit results by.

Список изменений

С версии 5.6.0 Введена.

Где вызывается хук

comments_template()
comments_template_top_level_query_args
wp-includes/comment-template.php 1516
$top_level_args = apply_filters( 'comments_template_top_level_query_args', $top_level_args );

Где используется хук в WordPress

Использование не найдено.