get_approved_comments


get_approved_comments ( $post_id, $args = array() )

Parameters:
  • (int) post_id The ID of the post.
  • (array) args { Optional. See WP_Comment_Query::__construct() for information on accepted arguments. @type int $status Comment status to limit results by. Defaults to approved comments. @type int $post_id Limit results to those affiliated with a given post ID. @type string $order How to order retrieved comments. Default 'ASC'. }
Returns:
  • (WP_Comment[]|int[]|int) The approved comments, or number of comments if `$count` argument is true.
Defined at:
Change Log:
  • 4: .

Description

Retrieves the approved comments for a post.

Related Functions

get_comments, get_pending_comments_num, have_comments, get_page_of_comment, get_comment

Top Google Results

User discussions

wpseek mobile