# current_theme_supports()

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

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

## Сигнатура

```php
current_theme_supports( string $feature, mixed $args ): bool
```

## Описание

Пример использования:
current_theme_supports( 'custom-logo' );
current_theme_supports( 'html5', 'comment-form' );

## Параметры

- `$feature` `string` — обязательный. Проверяемая возможность. Список возможных значений см. в add_theme_support().
- `$args` `mixed` — необязательный. Необязательные дополнительные аргументы для проверки применительно к определённым возможностям.

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

`bool`

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

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

```php
function current_theme_supports( $feature, ...$args ) {
	global $_wp_theme_features;

	if ( 'custom-header-uploads' === $feature ) {
		return current_theme_supports( 'custom-header', 'uploads' );
	}

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

	// If no args passed then no extra checks need to be performed.
	if ( ! $args ) {
		/** This filter is documented in wp-includes/theme.php */
		return apply_filters( "current_theme_supports-{$feature}", true, $args, $_wp_theme_features[ $feature ] ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
	}

	switch ( $feature ) {
		case 'post-thumbnails':
			/*
			 * post-thumbnails can be registered for only certain content/post types
			 * by passing an array of types to add_theme_support().
			 * If no array was passed, then any type is accepted.
			 */
			if ( true === $_wp_theme_features[ $feature ] ) {  // Registered for all types.
				return true;
			}
			$content_type = $args[0];
			return in_array( $content_type, $_wp_theme_features[ $feature ][0], true );

		case 'html5':
		case 'post-formats':
			/*
			 * Specific post formats can be registered by passing an array of types
			 * to add_theme_support().
			 *
			 * Specific areas of HTML5 support *must* be passed via an array to add_theme_support().
			 */
			$type = $args[0];
			return in_array( $type, $_wp_theme_features[ $feature ][0], true );

		case 'custom-logo':
		case 'custom-header':
		case 'custom-background':
			// Specific capabilities can be registered by passing an array to add_theme_support().
			return ( isset( $_wp_theme_features[ $feature ][0][ $args[0] ] ) && $_wp_theme_features[ $feature ][0][ $args[0] ] );
	}

	/**
	 * Filters whether the active theme supports a specific feature.
	 *
	 * The dynamic portion of the hook name, `$feature`, refers to the specific
	 * theme feature. See add_theme_support() for the list of possible values.
	 *
	 * @since 3.4.0
	 *
	 * @param bool   $supports Whether the active theme supports the given feature. Default true.
	 * @param array  $args     Array of arguments for the feature.
	 * @param string $feature  The theme feature.
	 */
	return apply_filters( "current_theme_supports-{$feature}", true, $args, $_wp_theme_features[ $feature ] ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
}
```

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

- 5.3.0 — Formalized the existing and already documented ...$args parameter by adding it to the function signature.
- 2.9.0 — Introduced.

## Связанные

Использует: [`current_theme_supports`](https://chugunov.pro/api-wordpress/functions/current_theme_supports/), [`apply_filters`](https://chugunov.pro/api-wordpress/functions/apply_filters/).
Используется в: [`_wp_render_title_tag`](https://chugunov.pro/api-wordpress/functions/_wp_render_title_tag/), `WP_REST_Attachments_Controller::handle_featured_media`, [`wp_enqueue_admin_bar_bump_styles`](https://chugunov.pro/api-wordpress/functions/wp_enqueue_admin_bar_bump_styles/), [`wp_enqueue_block_template_skip_link`](https://chugunov.pro/api-wordpress/functions/wp_enqueue_block_template_skip_link/), `WP_Theme_JSON::get_layout_styles`, [`_wp_get_iframed_editor_assets`](https://chugunov.pro/api-wordpress/functions/_wp_get_iframed_editor_assets/), [`_add_default_theme_supports`](https://chugunov.pro/api-wordpress/functions/_add_default_theme_supports/), [`_add_template_loader_filters`](https://chugunov.pro/api-wordpress/functions/_add_template_loader_filters/), `WP_Theme_JSON_Resolver::get_theme_data`, [`the_block_template_skip_link`](https://chugunov.pro/api-wordpress/functions/the_block_template_skip_link/), [`get_block_editor_settings`](https://chugunov.pro/api-wordpress/functions/get_block_editor_settings/), [`get_block_editor_theme_styles`](https://chugunov.pro/api-wordpress/functions/get_block_editor_theme_styles/), [`locate_block_template`](https://chugunov.pro/api-wordpress/functions/locate_block_template/), [`get_media_states`](https://chugunov.pro/api-wordpress/functions/get_media_states/), [`register_block_type_from_metadata`](https://chugunov.pro/api-wordpress/functions/register_block_type_from_metadata/), `WP_REST_Themes_Controller::prepare_item_for_response`, [`wp_common_block_scripts_and_styles`](https://chugunov.pro/api-wordpress/functions/wp_common_block_scripts_and_styles/), [`register_and_do_post_meta_boxes`](https://chugunov.pro/api-wordpress/functions/register_and_do_post_meta_boxes/), `WP_Customize_Nav_Menu_Locations_Control::content_template`, `WP_Theme::get_post_templates`, [`_custom_logo_header_styles`](https://chugunov.pro/api-wordpress/functions/_custom_logo_header_styles/), `WP_Customize_Widgets::customize_dynamic_partial_args`, `WP_Customize_Widgets::selective_refresh_init`, `WP_Customize_Widgets::get_selective_refreshable_widgets`, `WP_Customize_Nav_Menus::customize_register`, `WP_Customize_Nav_Menus::available_item_types`, `WP_Customize_Panel::check_capabilities`, [`wp_generate_attachment_metadata`](https://chugunov.pro/api-wordpress/functions/wp_generate_attachment_metadata/), [`get_media_item`](https://chugunov.pro/api-wordpress/functions/get_media_item/), [`get_default_post_to_edit`](https://chugunov.pro/api-wordpress/functions/get_default_post_to_edit/), [`post_format_meta_box`](https://chugunov.pro/api-wordpress/functions/post_format_meta_box/), `WP_Posts_List_Table::inline_edit`, `Custom_Image_Header::get_header_dimensions`, `Custom_Image_Header::ajax_header_crop`, `Custom_Image_Header::step_1`, `Custom_Image_Header::step_2`, `Custom_Image_Header::step_3`, `Custom_Image_Header::js_includes`, `Custom_Image_Header::css_includes`, `Custom_Image_Header::js`.

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