WordPress at a glance

get_comments() WP 1.0

Retrieve a list of comments.

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

Works based on: WP_Comment_Query()

No Hooks.


Int|Array. 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 5.7.2

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

From category: Comments

No comments
    Log In