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

  • (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'. }
  • (WP_Comment[]|int[]|int) The approved comments, or number of comments if `$count` argument is true.
Defined at:
Change Log:
  • 4: .


Retrieves the approved comments for a post.

Related Functions

get_comments, have_comments, get_pending_comments_num, get_page_of_comment, get_comment

Top Google Results

User discussions

wpseek mobile