comments_array хук-фильтрWP 2.1.0

Filters the comments array.

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

add_filter( 'comments_array', 'wp_kama_comments_array_filter', 10, 2 );

/**
 * Function for `comments_array` filter-hook.
 * 
 * @param array $comments Array of comments supplied to the comments template.
 * @param int   $post_id  Post ID.
 *
 * @return array
 */
function wp_kama_comments_array_filter( $comments, $post_id ){

	// filter...
	return $comments;
}
$comments(массив)
Array of comments supplied to the comments template.
$post_id(int)
Post ID.

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

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

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

comments_template()
comments_array
wp-includes/comment-template.php 1579
$wp_query->comments = apply_filters( 'comments_array', $comments_flat, $post->ID );

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

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