# core_upgrade_preamble()

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

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

## Сигнатура

```php
core_upgrade_preamble()
```

## Описание

Показывает форму обновления WordPress для загрузки последней версии или автоматического обновления.

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

Файл: `wp-admin/update-core.php:245`

```php
function core_upgrade_preamble() {
	$updates = get_core_updates();

	// Include an unmodified $wp_version.
	require ABSPATH . WPINC . '/version.php';

	$is_development_version = preg_match( '/alpha|beta|RC/', $wp_version );

	if ( isset( $updates[0]->version ) && version_compare( $updates[0]->version, $wp_version, '>' ) ) {
		echo '<h2 class="response">';
		_e( 'An updated version of WordPress is available.' );
		echo '</h2>';

		$message = sprintf(
			/* translators: 1: Documentation on WordPress backups, 2: Documentation on updating WordPress. */
			__( '<strong>Important:</strong> Before updating, please <a href="%1$s">back up your database and files</a>. For help with updates, visit the <a href="%2$s">Updating WordPress</a> documentation page.' ),
			__( 'https://developer.wordpress.org/advanced-administration/security/backup/' ),
			__( 'https://wordpress.org/documentation/article/updating-wordpress/' )
		);
		wp_admin_notice(
			$message,
			array(
				'type'               => 'warning',
				'additional_classes' => array( 'inline' ),
			)
		);
	} elseif ( $is_development_version ) {
		echo '<h2 class="response">' . __( 'You are using a development version of WordPress.' ) . '</h2>';
	} else {
		echo '<h2 class="response">' . __( 'You have the latest version of WordPress.' ) . '</h2>';
	}

	echo '<ul class="core-updates">';
	foreach ( (array) $updates as $update ) {
		echo '<li>';
		list_core_update( $update );
		echo '</li>';
	}
	echo '</ul>';

	// Don't show the maintenance mode notice when we are only showing a single re-install option.
	if ( $updates && ( count( $updates ) > 1 || 'latest' !== $updates[0]->response ) ) {
		echo '<p>' . __( 'While your site is being updated, it will be in maintenance mode. As soon as your updates are complete, this mode will be deactivated.' ) . '</p>';
	} elseif ( ! $updates ) {
		list( $normalized_version ) = explode( '-', $wp_version );
		echo '<p>' . sprintf(
			/* translators: 1: URL to About screen, 2: WordPress version. */
			__( '<a href="%1$s">Learn more about WordPress %2$s</a>.' ),
			esc_url( self_admin_url( 'about.php' ) ),
			$normalized_version
		) . '</p>';
	}

	dismissed_updates();
}
```

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

- 2.7.0 — Introduced.

## Связанные

Использует: [`wp_admin_notice`](https://chugunov.pro/api-wordpress/functions/wp_admin_notice/), [`get_core_updates`](https://chugunov.pro/api-wordpress/functions/get_core_updates/), [`list_core_update`](https://chugunov.pro/api-wordpress/functions/list_core_update/), [`dismissed_updates`](https://chugunov.pro/api-wordpress/functions/dismissed_updates/), [`self_admin_url`](https://chugunov.pro/api-wordpress/functions/self_admin_url/), [`_e`](https://chugunov.pro/api-wordpress/functions/_e/), [`__`](https://chugunov.pro/api-wordpress/functions/__/), [`esc_url`](https://chugunov.pro/api-wordpress/functions/esc_url/).

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