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.


Int/Array. List of comments or number of found comments if $count argument is true.

Works based on: WP_Comment_Query()

No Hooks.


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

Список изменений

С версии 2.7.0 Введена.

Code of get_comments() WP 5.5.1

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

Related Functions

From category: Comments

No comments
    Log In . Register