get_comments

Advertisement

Summery Summery

Retrieve a list of comments.

Syntax Syntax

get_comments( string|array $args = '' )

Description Description

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

Parameters Parameters

$args

(string|array) (Optional) Array or string of arguments. See WP_Comment_Query::__construct() for information on accepted arguments.

Default value: ''

Return Return

(int|array) List of comments or number of found comments if $count argument is true.

Source Source

File: wp-includes/comment.php

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

Advertisement

Changelog Changelog

Changelog
Version Description
2.7.0 Introduced.

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.