首页 WordPress函数大全 get_comments_number()

get_comments_number()

2020-05-01 / 2297阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

get_comments_number( int|WP_Post $post_id )

Retrieves the amount of comments a post has.

描述

参数

$post_id

(int|WP_Post)
(Optional)
Post ID or WP_Post object. Default is the global $post.

返回

(string|int) If the post exists, a numeric string representing the number of comments the post has, otherwise 0.

大家谈论
    我的见解