get_comments_number

过滤钩子
apply_filters( 'get_comments_number', $count, $post_id )
参数
  • (string|int) $count A string representing the number of comments a post has, otherwise 0.
    Required:
  • (int) $post_id Post ID.
    Required:
定义位置
相关勾子
comments_numberget_comment_timeget_comments_linkrest_comment_queryget_comment_author
相关方法
get_comments_numberget_comments_number_textcomments_numberget_comment_metaget_comment_timeget_comments_link
引入
1.5.0
弃用
-

get_comments_number: 这个函数检索给定文章的评论数: 该函数只接受一个参数,即文章的ID,并返回一个代表评论数量的整数。

过滤一个文章的返回评论数。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
return apply_filters( 'get_comments_number', $count, $post_id );
return apply_filters( 'get_comments_number', $count, $post_id );
return apply_filters( 'get_comments_number', $count, $post_id );

常见问题

FAQs
查看更多 >
闪电伯伯

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

2025-11-19 01:27:40

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

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

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