# _remove_theme_support()

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

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

## Сигнатура

```php
_remove_theme_support( string $feature ): bool
```

## Описание

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

## Параметры

- `$feature` `string` — обязательный. Удаляемая возможность. Список возможных значений см. в add_theme_support().

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

`bool`

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

Файл: `wp-includes/theme.php:3090`

```php
function _remove_theme_support( $feature ) {
	global $_wp_theme_features;

	switch ( $feature ) {
		case 'custom-header-uploads':
			if ( ! isset( $_wp_theme_features['custom-header'] ) ) {
				return false;
			}
			add_theme_support( 'custom-header', array( 'uploads' => false ) );
			return true; // Do not continue - custom-header-uploads no longer exists.
	}

	if ( ! isset( $_wp_theme_features[ $feature ] ) ) {
		return false;
	}

	switch ( $feature ) {
		case 'custom-header':
			if ( ! did_action( 'wp_loaded' ) ) {
				break;
			}
			$support = get_theme_support( 'custom-header' );
			if ( isset( $support[0]['wp-head-callback'] ) ) {
				remove_action( 'wp_head', $support[0]['wp-head-callback'] );
			}
			if ( isset( $GLOBALS['custom_image_header'] ) ) {
				remove_action( 'admin_menu', array( $GLOBALS['custom_image_header'], 'init' ) );
				unset( $GLOBALS['custom_image_header'] );
			}
			break;

		case 'custom-background':
			if ( ! did_action( 'wp_loaded' ) ) {
				break;
			}
			$support = get_theme_support( 'custom-background' );
			if ( isset( $support[0]['wp-head-callback'] ) ) {
				remove_action( 'wp_head', $support[0]['wp-head-callback'] );
			}
			remove_action( 'admin_menu', array( $GLOBALS['custom_background'], 'init' ) );
			unset( $GLOBALS['custom_background'] );
			break;
	}

	unset( $_wp_theme_features[ $feature ] );

	return true;
}
```

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

- 3.1.0 — Introduced.

## Связанные

Использует: [`add_theme_support`](https://chugunov.pro/api-wordpress/functions/add_theme_support/), [`get_theme_support`](https://chugunov.pro/api-wordpress/functions/get_theme_support/), [`remove_action`](https://chugunov.pro/api-wordpress/functions/remove_action/), [`did_action`](https://chugunov.pro/api-wordpress/functions/did_action/).
Используется в: [`remove_editor_styles`](https://chugunov.pro/api-wordpress/functions/remove_editor_styles/), [`remove_theme_support`](https://chugunov.pro/api-wordpress/functions/remove_theme_support/), [`unregister_nav_menu`](https://chugunov.pro/api-wordpress/functions/unregister_nav_menu/).

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