# wp_update_https_migration_required()

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

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

## Сигнатура

```php
wp_update_https_migration_required( mixed $old_url, mixed $new_url )
```

## Описание

Если это новый сайт, миграция не потребуется, поэтому опции будет присвоено значение false.
Подключается к действию ‘update_option_home’.

## Параметры

- `$old_url` `mixed` — обязательный. Предыдущее значение опции URL.
- `$new_url` `mixed` — обязательный. Новое значение опции URL.

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

Файл: `wp-includes/https-migration.php:126`

```php
function wp_update_https_migration_required( $old_url, $new_url ) {
	// Do nothing if WordPress is being installed.
	if ( wp_installing() ) {
		return;
	}

	// Delete/reset the option if the new URL is not the HTTPS version of the old URL.
	if ( untrailingslashit( (string) $old_url ) !== str_replace( 'https://', 'http://', untrailingslashit( (string) $new_url ) ) ) {
		delete_option( 'https_migration_required' );
		return;
	}

	// If this is a fresh site, there is no content to migrate, so do not require migration.
	$https_migration_required = get_option( 'fresh_site' ) ? false : true;

	update_option( 'https_migration_required', $https_migration_required );
}
```

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

- 5.7.0 — Introduced.

## Связанные

Использует: [`wp_installing`](https://chugunov.pro/api-wordpress/functions/wp_installing/), [`untrailingslashit`](https://chugunov.pro/api-wordpress/functions/untrailingslashit/), [`delete_option`](https://chugunov.pro/api-wordpress/functions/delete_option/), [`update_option`](https://chugunov.pro/api-wordpress/functions/update_option/), [`get_option`](https://chugunov.pro/api-wordpress/functions/get_option/).

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