comments_array

过滤钩子


apply_filters( 'comments_array', $comments_flat, $post->ID )
参数
  • (array)
    $comments
    Array of comments supplied to the comments template.
    Required:
  • (int)
    $post_id
    Post ID.
    Required:
定义位置
  • wp-includes/comment-template.php
    , line 1514
引入
2.1.0
弃用

过滤评论数组。

$wp_query->comments = apply_filters( 'comments_array', $comments_flat, $post->ID );