get_page_of_comment_query_args

过滤钩子
apply_filters( 'get_page_of_comment_query_args', $comment_args )
参数
  • (array) $comment_args { Array of WP_Comment_Query arguments. @type string $type Limit paginated comments to those matching a given type. Accepts 'comment', 'trackback', 'pingback', 'pings' (trackbacks and pingbacks), or 'all'. Default 'all'. @type int $post_id ID of the post. @type string $fields Comment fields to return. @type bool $count Whether to return a comment count (true) or array of comment objects (false). @type string $status Comment status. @type int $parent Parent ID of comment to retrieve children of. @type array $date_query Date query clauses to limit comments by. See WP_Date_Query. @type array $include_unapproved Array of IDs or email addresses whose unapproved comments will be included in paginated comments. }
    Required:
定义位置
相关勾子
get_page_of_commentrest_comment_querypre_comment_user_agentwidget_comments_argscomments_template_query_args
相关方法
get_page_of_commentwp_edit_attachments_query_varsget_comment_metaget_cancel_comment_reply_linkget_comments_numberget_comment_class
引入
5.5.0
弃用
-

get_page_of_comment_query_args是一个WordPress函数,用于检索用于检索给定文章的评论的查询参数: 该函数接受一个文章ID作为参数,并返回一个用于评论查询的参数数组。

过滤get_page_of_comment()中用于查询评论的参数。

$comment_args = apply_filters( 'get_page_of_comment_query_args', $comment_args );

常见问题

FAQs
查看更多 >