# get_sites()

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

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

## Сигнатура

```php
get_sites( string|array $args = array() ): WP_Site[]|int[]|int
```

## Описание

[See also](#see-also)
- [WP_Site_Query::parse_query()](https://developer.wordpress.org/reference/classes/WP_Site_Query/parse_query/)

## Параметры

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

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

`WP_Site[]|int[]|int` — WP_Site 'fields' 'ids' 'count'

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

Файл: `wp-includes/ms-site.php:445`

```php
function get_sites( $args = array() ) {
	$query = new WP_Site_Query();

	return $query->query( $args );
}
```

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

- 4.8.0 — Introduced the 'lang_id', 'lang__in', and 'lang__not_in' parameters.
- 4.6.0 — Introduced.

## Связанные

Использует: `WP_Site_Query::__construct`.
Используется в: [`get_oembed_response_data_for_url`](https://chugunov.pro/api-wordpress/functions/get_oembed_response_data_for_url/), `WP_Network::get_main_site_id`, `WP_MS_Sites_List_Table::prepare_items`, `WP_Importer::set_blog`, [`get_blogs_of_user`](https://chugunov.pro/api-wordpress/functions/get_blogs_of_user/), [`wp_get_sites`](https://chugunov.pro/api-wordpress/functions/wp_get_sites/), [`wp_update_network_site_counts`](https://chugunov.pro/api-wordpress/functions/wp_update_network_site_counts/), [`domain_exists`](https://chugunov.pro/api-wordpress/functions/domain_exists/), [`get_blog_id_from_url`](https://chugunov.pro/api-wordpress/functions/get_blog_id_from_url/), [`get_site_by_path`](https://chugunov.pro/api-wordpress/functions/get_site_by_path/), [`get_id_from_blogname`](https://chugunov.pro/api-wordpress/functions/get_id_from_blogname/).

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