get_comments

Definition:
function get_comments( $args = '' ) {}

Retrieve a list of comments.
The comment list can be for the blog as a whole or for an individual post.

Parameters

  • mixed $args: Optional. Array or string of options to override defaults.

Return values

returns:List of comments.

Source code

function get_comments( $args = '' ) {

	$query = new WP_Comment_Query;

	return $query->query( $args );

}

1280

2 Responses to “get_comments”

  1. Unknown's avatar

    Where would I put this code on a page to obtain the comments from a certain post?

Leave a comment