# get_site_transient()

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

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

## Сигнатура

```php
get_site_transient( string $transient ): mixed
```

## Описание

Если транзиент не существует, не имеет значения или его срок истёк, возвращаемым значением будет false.
См. alsoget_transient()

## Параметры

- `$transient` `string` — обязательный. Имя транзиента. Ожидается, что не экранировано для SQL.

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

`mixed`

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

Файл: `wp-includes/option.php:2562`

```php
function get_site_transient( $transient ) {

	/**
	 * Filters the value of an existing site transient before it is retrieved.
	 *
	 * The dynamic portion of the hook name, `$transient`, refers to the transient name.
	 *
	 * Returning a value other than boolean false will short-circuit retrieval and
	 * return that value instead.
	 *
	 * @since 2.9.0
	 * @since 4.4.0 The `$transient` parameter was added.
	 *
	 * @param mixed  $pre_site_transient The default value to return if the site transient does not exist.
	 *                                   Any value other than false will short-circuit the retrieval
	 *                                   of the transient, and return that value.
	 * @param string $transient          Transient name.
	 */
	$pre = apply_filters( "pre_site_transient_{$transient}", false, $transient );

	if ( false !== $pre ) {
		return $pre;
	}

	if ( wp_using_ext_object_cache() || wp_installing() ) {
		$value = wp_cache_get( $transient, 'site-transient' );
	} else {
		// Core transients that do not have a timeout. Listed here so querying timeouts can be avoided.
		$no_timeout       = array( 'update_core', 'update_plugins', 'update_themes' );
		$transient_option = '_site_transient_' . $transient;
		if ( ! in_array( $transient, $no_timeout, true ) ) {
			$transient_timeout = '_site_transient_timeout_' . $transient;
			wp_prime_site_option_caches( array( $transient_option, $transient_timeout ) );

			$timeout = get_site_option( $transient_timeout );
			if ( false !== $timeout && $timeout < time() ) {
				delete_site_option( $transient_option );
				delete_site_option( $transient_timeout );
				$value = false;
			}
		}

		if ( ! isset( $value ) ) {
			$value = get_site_option( $transient_option );
		}
	}

	/**
	 * Filters the value of an existing site transient.
	 *
	 * The dynamic portion of the hook name, `$transient`, refers to the transient name.
	 *
	 * @since 2.9.0
	 * @since 4.4.0 The `$transient` parameter was added.
	 *
	 * @param mixed  $value     Value of site transient.
	 * @param string $transient Transient name.
	 */
	return apply_filters( "site_transient_{$transient}", $value, $transient );
}
```

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

- 2.9.0 — Introduced.

## Связанные

Использует: [`wp_prime_site_option_caches`](https://chugunov.pro/api-wordpress/functions/wp_prime_site_option_caches/), [`wp_installing`](https://chugunov.pro/api-wordpress/functions/wp_installing/), [`wp_using_ext_object_cache`](https://chugunov.pro/api-wordpress/functions/wp_using_ext_object_cache/), [`delete_site_option`](https://chugunov.pro/api-wordpress/functions/delete_site_option/), [`wp_cache_get`](https://chugunov.pro/api-wordpress/functions/wp_cache_get/), [`apply_filters`](https://chugunov.pro/api-wordpress/functions/apply_filters/), [`get_site_option`](https://chugunov.pro/api-wordpress/functions/get_site_option/).
Используется в: `WP_Debug_Data::get_wp_active_theme`, `WP_Debug_Data::get_wp_parent_theme`, `WP_Debug_Data::get_wp_themes_inactive`, `WP_Debug_Data::get_wp_plugins_raw_data`, `WP_Plugin_Dependencies::get_dependency_api_data`, `WP_Font_Collection::load_from_url`, `WP_Theme::get_pattern_cache`, `WP_REST_URL_Details_Controller::get_cache`, `WP_REST_Pattern_Directory_Controller::get_items`, `WP_MS_Themes_List_Table::column_autoupdates`, [`wp_check_php_version`](https://chugunov.pro/api-wordpress/functions/wp_check_php_version/), `WP_Plugin_Install_List_Table::get_installed_plugins`, `WP_Community_Events::get_cached_events`, [`wp_ajax_update_theme`](https://chugunov.pro/api-wordpress/functions/wp_ajax_update_theme/), [`wp_get_available_translations`](https://chugunov.pro/api-wordpress/functions/wp_get_available_translations/), `WP_Automatic_Updater::run`, `Plugin_Upgrader::bulk_upgrade`, `Theme_Upgrader::upgrade`, `Theme_Upgrader::bulk_upgrade`, `Plugin_Upgrader::upgrade`, [`wp_prepare_themes_for_js`](https://chugunov.pro/api-wordpress/functions/wp_prepare_themes_for_js/), [`get_theme_update_available`](https://chugunov.pro/api-wordpress/functions/get_theme_update_available/), [`get_theme_feature_list`](https://chugunov.pro/api-wordpress/functions/get_theme_feature_list/), `WP_Plugins_List_Table::prepare_items`, `WP_MS_Themes_List_Table::prepare_items`, [`get_core_updates`](https://chugunov.pro/api-wordpress/functions/get_core_updates/), [`find_core_auto_update`](https://chugunov.pro/api-wordpress/functions/find_core_auto_update/), [`find_core_update`](https://chugunov.pro/api-wordpress/functions/find_core_update/), [`get_plugin_updates`](https://chugunov.pro/api-wordpress/functions/get_plugin_updates/), [`wp_plugin_update_rows`](https://chugunov.pro/api-wordpress/functions/wp_plugin_update_rows/), [`wp_plugin_update_row`](https://chugunov.pro/api-wordpress/functions/wp_plugin_update_row/), [`get_theme_updates`](https://chugunov.pro/api-wordpress/functions/get_theme_updates/), [`wp_theme_update_rows`](https://chugunov.pro/api-wordpress/functions/wp_theme_update_rows/), [`wp_theme_update_row`](https://chugunov.pro/api-wordpress/functions/wp_theme_update_row/), [`wp_check_browser_version`](https://chugunov.pro/api-wordpress/functions/wp_check_browser_version/), [`install_popular_tags`](https://chugunov.pro/api-wordpress/functions/install_popular_tags/), [`install_plugin_install_status`](https://chugunov.pro/api-wordpress/functions/install_plugin_install_status/), [`delete_plugins`](https://chugunov.pro/api-wordpress/functions/delete_plugins/), [`wp_get_popular_importers`](https://chugunov.pro/api-wordpress/functions/wp_get_popular_importers/), [`wp_credits`](https://chugunov.pro/api-wordpress/functions/wp_credits/).

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