# get_comments()

URL: https://chugunov.pro/api-wordpress/functions/get_comments/
Проверено на WordPress 6.9, обновлено 06.08.2026.
Источник: независимый русскоязычный справочник chugunov.pro. Не является официальной документацией WordPress.

Тип: функция.
Появился в версии: 2.7.0.

## Сигнатура

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

## Описание

Список комментариев может относиться ко всему блогу или к отдельной записи.

## Параметры

- `$args` `string|array` — необязательный, по умолчанию `''`. Array or string of arguments. See [WP_Comment_Query::__construct()](https://developer.wordpress.org/reference/classes/wp_comment_query/__construct/) for information on accepted arguments.

## Возвращаемое значение

`WP_Comment[]|int[]|int` — $count

## Исходный код

Файл: `wp-includes/comment.php:271`

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

## История изменений

- 2.7.0 — Introduced.

## Связанные

Использует: `WP_Comment_Query::__construct`.
Используется в: `WP_Comments_List_Table::comment_type_dropdown`, [`wp_comments_personal_data_exporter`](https://chugunov.pro/api-wordpress/functions/wp_comments_personal_data_exporter/), [`wp_comments_personal_data_eraser`](https://chugunov.pro/api-wordpress/functions/wp_comments_personal_data_eraser/), `WP_Comment::get_children`, `WP_Comment_Query::fill_descendants`, [`wp_dashboard_recent_comments`](https://chugunov.pro/api-wordpress/functions/wp_dashboard_recent_comments/), [`post_comment_meta_box`](https://chugunov.pro/api-wordpress/functions/post_comment_meta_box/), `WP_Comments_List_Table::get_views`, `WP_Comments_List_Table::prepare_items`, `WP_Widget_Recent_Comments::widget`, `wp_xmlrpc_server::wp_getComments`, [`wp_list_comments`](https://chugunov.pro/api-wordpress/functions/wp_list_comments/), [`get_comment_count`](https://chugunov.pro/api-wordpress/functions/get_comment_count/).

Оригинал в официальной документации: https://developer.wordpress.org/reference/functions/get_comments/
