функция
since 2.7.0
get_comments()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
get_comments( string|array $args = '' ): WP_Comment[]|int[]|int
Описание
Список комментариев может относиться ко всему блогу или к отдельной записи.
Оригинал (английский)
The comment list can be for the blog as a whole or for an individual post.
Параметры
$args
string|array
необязательный
= ''
Array or string of arguments. See WP_Comment_Query::__construct() for information on accepted arguments.
Возвращаемое значение
WP_Comment[]|int[]|int
$count
Исходный код
wp-includes/comment.php:271
function get_comments( $args = '' ) {
$query = new WP_Comment_Query();
return $query->query( $args );
}
История изменений
| Версия | Описание |
|---|---|
| 2.7.0 | Introduced. |

