1. 首页
  2. WordPress钩子手册

comments_array

apply_filters( ‘comments_array’, array $comments, int $post_ID )

过滤器::过滤注释数组。
Filter Hook: Filters the comments array.

目录锚点:#参数#源码#笔记


参数(Parameters)

参数 类型 说明
$comments (array) 提供给注释模板的注释数组。
$post_ID (int) 邮政编码。

源码(Source)


更新版本 源码位置 使用 被使用
2.1.0 wp-includes/comment-template.php:1494 1 0

笔记(Notes)

如果要隐藏帖子的所有现有评论,请使用以下函数返回空数组:

comments_array 为WP2原创文章,链接:https://www.wp2.cn/hook/comments_array/