wpseek.com
A WordPress-centric search engine for devs and theme authors



get_comments › WordPress Function

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 string.
    Required: No
    Default: (empty)
Returns:
  • (WP_Comment[]|int[]|int) List of comments or number of found comments if `$count` argument is true.
Defined at:
Codex:

Retrieves 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 );
}