comments_array хук-фильтр . WP 2.1.0
Filters the comments array.
Использование
add_filter( 'comments_array', 'filter_function_name_5814', 10, 2 ); function filter_function_name_5814( $comments, $post_ID ){ // filter... return $comments; }
- $comments(массив)
- Array of comments supplied to the comments template.
- $post_ID(число)
- Post ID.
Список изменений
С версии 2.1.0 | Введена. |
Где вызывается хук
wp-includes/comment-template.php 1518
$wp_query->comments = apply_filters( 'comments_array', $comments_flat, $post->ID );