get_comments

函数
get_comments ( $args = '' )
参数
  • (string|array) $args Optional. Array or string of arguments. See WP_Comment_Query::__construct() for information on accepted arguments. Default empty.
    Required:
    Default: (empty)
返回值
  • (WP_Comment[]|int[]|int) List of comments or number of found comments if `$count` argument is true.
定义位置
相关方法
get_commentget_comment_idget_comment_classedit_commentget_comments_link
引入
2.7.0
弃用
-

get_comments: 这个函数用来检索一个给定文章或页面的评论数组。评论可以根据各种标准进行过滤,如状态,父,类型等。

检索评论列表。

评论列表可以是整个博客的,也可以是个别文章的。

function get_comments( $args = '' ) {
	$query = new WP_Comment_Query;
	return $query->query( $args );
}

常见问题

FAQs
查看更多 >
闪电侠

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

2025-12-05 18:32:58

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

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

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