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.

Return

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

Usage

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

Code of get_comments: wp-includes/comment.php VER 4.9.8

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

Related Functions

From category: Comments

No comments
    Hello, !     Log In . Register