WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

wp_upgrade() WP 2.1.0

Runs WordPress Upgrade functions.

Upgrades the database if needed during a site update.

Хуки из функции
Возвращает

Null. Ничего.

Использование

wp_upgrade();

Заметки

  • Global. Число. $wp_current_db_version The old (current) database version.
  • Global. Число. $wp_db_version The new database version.
  • Global. wpdb. $wpdb WordPress database abstraction object.

Список изменений

С версии 2.1.0 Введена.

Код wp_upgrade() WP 5.5.1

wp-admin/includes/upgrade.php
<?php
function wp_upgrade() {
	global $wp_current_db_version, $wp_db_version, $wpdb;

	$wp_current_db_version = __get_option( 'db_version' );

	// We are up to date. Nothing to do.
	if ( $wp_db_version == $wp_current_db_version ) {
		return;
	}

	if ( ! is_blog_installed() ) {
		return;
	}

	wp_check_mysql_version();
	wp_cache_flush();
	pre_schema_upgrade();
	make_db_current_silent();
	upgrade_all();
	if ( is_multisite() && is_main_site() ) {
		upgrade_network();
	}
	wp_cache_flush();

	if ( is_multisite() ) {
		update_site_meta( get_current_blog_id(), 'db_version', $wp_db_version );
		update_site_meta( get_current_blog_id(), 'db_last_updated', microtime() );
	}

	/**
	 * Fires after a site is fully upgraded.
	 *
	 * @since 3.9.0
	 *
	 * @param int $wp_db_version         The new $wp_db_version.
	 * @param int $wp_current_db_version The old (current) $wp_db_version.
	 */
	do_action( 'wp_upgrade', $wp_db_version, $wp_current_db_version );
}