# get_core_checksums()

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

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

## Сигнатура

```php
get_core_checksums( string $version, string $locale ): array<string,
```

## Описание

Получает и кэширует контрольные суммы для заданной версии WordPress.

## Параметры

- `$version` `string` — обязательный. Строка версии для запроса.
- `$locale` `string` — обязательный. Локаль для запроса.

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

`array<string,`

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

Файл: `wp-admin/includes/update.php:131`

```php
function get_core_checksums( $version, $locale ) {
	$http_url = 'https://api.wordpress.org/core/checksums/1.0/?' . http_build_query( compact( 'version', 'locale' ), '', '&' );
	$url      = $http_url;

	$ssl = wp_http_supports( array( 'ssl' ) );

	if ( $ssl ) {
		$url = set_url_scheme( $url, 'https' );
	}

	$options = array(
		'timeout' => wp_doing_cron() ? 30 : 3,
	);

	$response = wp_remote_get( $url, $options );

	if ( $ssl && is_wp_error( $response ) ) {
		wp_trigger_error(
			__FUNCTION__,
			sprintf(
				/* translators: %s: Support forums URL. */
				__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
				__( 'https://wordpress.org/support/forums/' )
			) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ),
			headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE
		);

		$response = wp_remote_get( $http_url, $options );
	}

	if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {
		return false;
	}

	$body = trim( wp_remote_retrieve_body( $response ) );
	$body = json_decode( $body, true );

	if ( ! is_array( $body ) || ! isset( $body['checksums'] ) || ! is_array( $body['checksums'] ) ) {
		return false;
	}

	return $body['checksums'];
}
```

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

- 3.7.0 — Introduced.

## Связанные

Использует: [`wp_trigger_error`](https://chugunov.pro/api-wordpress/functions/wp_trigger_error/), [`wp_doing_cron`](https://chugunov.pro/api-wordpress/functions/wp_doing_cron/), [`set_url_scheme`](https://chugunov.pro/api-wordpress/functions/set_url_scheme/), [`wp_http_supports`](https://chugunov.pro/api-wordpress/functions/wp_http_supports/), [`wp_remote_get`](https://chugunov.pro/api-wordpress/functions/wp_remote_get/), [`wp_remote_retrieve_response_code`](https://chugunov.pro/api-wordpress/functions/wp_remote_retrieve_response_code/), [`wp_remote_retrieve_body`](https://chugunov.pro/api-wordpress/functions/wp_remote_retrieve_body/), [`__`](https://chugunov.pro/api-wordpress/functions/__/), [`is_wp_error`](https://chugunov.pro/api-wordpress/functions/is_wp_error/).
Используется в: `WP_Site_Health_Auto_Updates::test_all_files_writable`, `Core_Upgrader::check_files`, [`update_core`](https://chugunov.pro/api-wordpress/functions/update_core/).

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