A WordPress-centric search engine for devs and theme authors



get_comments ›

Since2.7.0
Deprecatedn/a
get_comments ( $args = '' )
Parameters:
  • (string|array) $args Optional. Array or string of arguments. See WP_Comment_Query::__construct() for information on accepted arguments. Default empty.
    Required: No
    Default: (empty)
Returns:
  • (int|array) List of comments or number of found comments if `$count` argument is true.
Defined at:
Codex:

Retrieve a list of comments.

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



Source

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