# get_block_editor_theme_styles()

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

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

## Сигнатура

```php
get_block_editor_theme_styles(): array
```

## Описание

Создаёт массив стилей темы для загрузки в редактор блоков.

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

`array`

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

Файл: `wp-includes/block-editor.php:768`

```php
function get_block_editor_theme_styles() {
	global $editor_styles;

	$styles = array();

	if ( $editor_styles && current_theme_supports( 'editor-styles' ) ) {
		foreach ( $editor_styles as $style ) {
			if ( preg_match( '~^(https?:)?//~', $style ) ) {
				$response = wp_remote_get( $style );
				if ( ! is_wp_error( $response ) ) {
					$styles[] = array(
						'css'            => wp_remote_retrieve_body( $response ),
						'__unstableType' => 'theme',
						'isGlobalStyles' => false,
					);
				}
			} else {
				$file = get_theme_file_path( $style );
				if ( is_file( $file ) ) {
					$styles[] = array(
						'css'            => file_get_contents( $file ),
						'baseURL'        => get_theme_file_uri( $style ),
						'__unstableType' => 'theme',
						'isGlobalStyles' => false,
					);
				}
			}
		}
	}

	return $styles;
}
```

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

- 5.8.0 — Introduced.

## Связанные

Использует: [`get_theme_file_path`](https://chugunov.pro/api-wordpress/functions/get_theme_file_path/), [`get_theme_file_uri`](https://chugunov.pro/api-wordpress/functions/get_theme_file_uri/), [`wp_remote_get`](https://chugunov.pro/api-wordpress/functions/wp_remote_get/), [`wp_remote_retrieve_body`](https://chugunov.pro/api-wordpress/functions/wp_remote_retrieve_body/), [`current_theme_supports`](https://chugunov.pro/api-wordpress/functions/current_theme_supports/), [`is_wp_error`](https://chugunov.pro/api-wordpress/functions/is_wp_error/).
Используется в: [`get_block_editor_settings`](https://chugunov.pro/api-wordpress/functions/get_block_editor_settings/).

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