get_comments( string|array $args = '' ): WP_Comment[]|int[]|int

Retrieves a list of comments.

Description

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

Parameters

$argsstring|arrayoptional
Array or string of arguments. See WP_Comment_Query::__construct() for information on accepted arguments.

Default:''

Return

WP_Comment[]|int[]|int List of comments or number of found comments if $count argument is true.

Source

	return $_comment;
} elseif ( ARRAY_A === $output ) {
	return $_comment->to_array();
} elseif ( ARRAY_N === $output ) {

Changelog

VersionDescription
2.7.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.