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:
定义位置
相关勾子
comment_urlcomment_authorcomments_per_pagecomment_atom_entrycomment_form
相关方法
comments_rsscomment_authorcomment_author_urlcomment_datecomments_numbercomment_type
引入
2.1.0
弃用
-

comments_array: 这个函数用来检索一个给定文章的评论数组。默认情况下,这个函数会返回该文章的所有评论,但你可以使用comments_array过滤器来修改返回的评论。

过滤评论数组。

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

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2025-12-05 20:33:00

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: