Esempio n. 1
0
/**
 * Functions to be called in install and upgrade scripts.
 *
 * {@internal Missing Long Description}}
 *
 * @since unknown
 */
function upgrade_all()
{
    global $wp_current_db_version, $wp_db_version, $wp_rewrite;
    $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 the version is not set in the DB, try to guess the version.
    if (empty($wp_current_db_version)) {
        $wp_current_db_version = 0;
        // If the template option exists, we have 1.5.
        $template = __get_option('template');
        if (!empty($template)) {
            $wp_current_db_version = 2541;
        }
    }
    if ($wp_current_db_version < 6039) {
        upgrade_230_options_table();
    }
    populate_options();
    if ($wp_current_db_version < 2541) {
        upgrade_100();
        upgrade_101();
        upgrade_110();
        upgrade_130();
    }
    if ($wp_current_db_version < 3308) {
        upgrade_160();
    }
    if ($wp_current_db_version < 4772) {
        upgrade_210();
    }
    if ($wp_current_db_version < 4351) {
        upgrade_old_slugs();
    }
    if ($wp_current_db_version < 5539) {
        upgrade_230();
    }
    if ($wp_current_db_version < 6124) {
        upgrade_230_old_tables();
    }
    if ($wp_current_db_version < 7499) {
        upgrade_250();
    }
    if ($wp_current_db_version < 7796) {
        upgrade_251();
    }
    if ($wp_current_db_version < 7935) {
        upgrade_252();
    }
    if ($wp_current_db_version < 8201) {
        upgrade_260();
    }
    if ($wp_current_db_version < 8989) {
        upgrade_270();
    }
    if ($wp_current_db_version < 10360) {
        upgrade_280();
    }
    if ($wp_current_db_version < 11958) {
        upgrade_290();
    }
    maybe_disable_automattic_widgets();
    update_option('db_version', $wp_db_version);
    update_option('db_upgraded', true);
}
function upgrade_all() {
	global $wp_current_db_version, $wp_db_version, $wp_rewrite;
	$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 the version is not set in the DB, try to guess the version.
	if ( empty($wp_current_db_version) ) {
		$wp_current_db_version = 0;

		// If the template option exists, we have 1.5.
		$template = __get_option('template');
		if ( !empty($template) )
			$wp_current_db_version = 2541;
	}

	if ( $wp_current_db_version < 6039 )
		upgrade_230_options_table();

	populate_options();

	if ( $wp_current_db_version < 2541 ) {
		upgrade_100();
		upgrade_101();
		upgrade_110();
		upgrade_130();
	}

	if ( $wp_current_db_version < 3308 )
		upgrade_160();

	if ( $wp_current_db_version < 4772 )
		upgrade_210();

	if ( $wp_current_db_version < 4351 )
		upgrade_old_slugs();

	if ( $wp_current_db_version < 5539 )
		upgrade_230();

	if ( $wp_current_db_version < 6124 )
		upgrade_230_old_tables();

	if ( $wp_current_db_version < 7499 )
		upgrade_250();

	if ( $wp_current_db_version < 7796 )
		upgrade_251();

	maybe_disable_automattic_widgets();

	$wp_rewrite->flush_rules();

	update_option('db_version', $wp_db_version);
}