# get_theme_mods()

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

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

## Сигнатура

```php
get_theme_mods(): array
```

## Описание

Получает все модификации темы.

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

`array`

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

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

```php
function get_theme_mods() {
	$theme_slug = get_option( 'stylesheet' );
	$mods       = get_option( "theme_mods_$theme_slug" );

	if ( false === $mods ) {
		$theme_name = get_option( 'current_theme' );
		if ( false === $theme_name ) {
			$theme_name = wp_get_theme()->get( 'Name' );
		}

		$mods = get_option( "mods_$theme_name" ); // Deprecated location.
		if ( is_admin() && false !== $mods ) {
			update_option( "theme_mods_$theme_slug", $mods );
			delete_option( "mods_$theme_name" );
		}
	}

	if ( ! is_array( $mods ) ) {
		$mods = array();
	}

	return $mods;
}
```

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

- 5.9.0 — The return value is always an array.
- 3.1.0 — Introduced.

## Связанные

Использует: [`delete_option`](https://chugunov.pro/api-wordpress/functions/delete_option/), [`wp_get_theme`](https://chugunov.pro/api-wordpress/functions/wp_get_theme/), `WP_Theme`, [`is_admin`](https://chugunov.pro/api-wordpress/functions/is_admin/), [`update_option`](https://chugunov.pro/api-wordpress/functions/update_option/), [`get_option`](https://chugunov.pro/api-wordpress/functions/get_option/).
Используется в: [`get_media_states`](https://chugunov.pro/api-wordpress/functions/get_media_states/), [`set_theme_mod`](https://chugunov.pro/api-wordpress/functions/set_theme_mod/), [`remove_theme_mod`](https://chugunov.pro/api-wordpress/functions/remove_theme_mod/), [`get_theme_mod`](https://chugunov.pro/api-wordpress/functions/get_theme_mod/).

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