wp_count_comments

过滤钩子


apply_filters( 'wp_count_comments', array()
参数
  • (array|stdClass)
    $count
    An empty array or an object containing comment counts.
    Required:
  • (int)
    $post_id
    The post ID. Can be 0 to represent the whole site.
    Required:
定义位置
  • wp-includes/comment.php
    , line 1410
引入
2.7.0
弃用

Filters the comments count for a given post or the whole site.

$filtered = apply_filters( 'wp_count_comments', array(), $post_id );