get_comments()WP 2.7.0

Retrieve a list of comments.

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

No Hooks.


WP_Comment[]|Int[]|Int. List of comments or number of found comments if $count argument is true.


get_comments( $args );
Array or string of arguments. See WP_Comment_Query::__construct() for information on accepted arguments.
Default: ''


Since 2.7.0 Introduced.

Code of get_comments() WP 6.0

function get_comments( $args = '' ) {
	$query = new WP_Comment_Query;
	return $query->query( $args );