WordPress at a glance
function is not described

get_approved_comments() WP 2.0.0

Retrieve the approved comments for post $post_id.

  • Since 4.1.0 Refactored to leverage WP_Comment_Query over a direct query.

No Hooks.

Return

Int/Array. $comments The approved comments, or number of comments if $count argument is true.

Usage

get_approved_comments( $post_id, $args );
$post_id(int) (required)
The ID of the post.
$args(array)
See WP_Comment_Query::__construct() for information on accepted arguments.
Default: array()

Code of get approved comments: wp-includes/comment.php WP 5.2.1

<?php
function get_approved_comments( $post_id, $args = array() ) {
	if ( ! $post_id ) {
		return array();
	}

	$defaults = array(
		'status'  => 1,
		'post_id' => $post_id,
		'order'   => 'ASC',
	);
	$r        = wp_parse_args( $args, $defaults );

	$query = new WP_Comment_Query;
	return $query->query( $r );
}