# wp_parse_list()

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

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

## Сигнатура

```php
wp_parse_list( array|string $input_list ): array
```

## Описание

Преобразует список скалярных значений, разделённых запятыми или пробелами, в массив.

## Параметры

- `$input_list` `array|string` — обязательный. Список значений.

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

`array`

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

Файл: `wp-includes/functions.php:4986`

```php
function wp_parse_list( $input_list ) {
	if ( ! is_array( $input_list ) ) {
		return preg_split( '/[\s,]+/', $input_list, -1, PREG_SPLIT_NO_EMPTY );
	}

	// Validate all entries of the list are scalar.
	$input_list = array_filter( $input_list, 'is_scalar' );

	return $input_list;
}
```

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

- 5.1.0 — Introduced.

## Связанные

Используется в: `WP_Theme::get_block_patterns`, `WP_REST_Pattern_Directory_Controller::get_transient_key`, `WP_REST_Menu_Items_Controller::get_item_schema`, [`rest_sanitize_array`](https://chugunov.pro/api-wordpress/functions/rest_sanitize_array/), [`rest_is_array`](https://chugunov.pro/api-wordpress/functions/rest_is_array/), [`rest_parse_embed_param`](https://chugunov.pro/api-wordpress/functions/rest_parse_embed_param/), `WP_REST_Controller::get_fields_for_response`, [`rest_filter_response_fields`](https://chugunov.pro/api-wordpress/functions/rest_filter_response_fields/), [`wp_parse_slug_list`](https://chugunov.pro/api-wordpress/functions/wp_parse_slug_list/), `WP_REST_Server::get_index`, `WP_Comment_Query::get_comment_ids`, [`wp_parse_id_list`](https://chugunov.pro/api-wordpress/functions/wp_parse_id_list/), [`get_pages`](https://chugunov.pro/api-wordpress/functions/get_pages/).

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