A WordPress-centric search engine for devs and theme authors



upgrade_300 ›

Since3.0.0
Deprecatedn/a
upgrade_300 ( No parameters )
Defined at:
Codex:

Execute changes made in WordPress 3.0.



Source

function upgrade_300() {
	global $wp_current_db_version, $wpdb;

	if ( $wp_current_db_version < 15093 ) {
		populate_roles_300();
	}

	if ( $wp_current_db_version < 14139 && is_multisite() && is_main_site() && ! defined( 'MULTISITE' ) && get_site_option( 'siteurl' ) === false ) {
		add_site_option( 'siteurl', '' );
	}

	// 3.0 screen options key name changes.
	if ( wp_should_upgrade_global_tables() ) {
		$sql    = "DELETE FROM $wpdb->usermeta
			WHERE meta_key LIKE %s
			OR meta_key LIKE %s
			OR meta_key LIKE %s
			OR meta_key LIKE %s
			OR meta_key LIKE %s
			OR meta_key LIKE %s
			OR meta_key = 'manageedittagscolumnshidden'
			OR meta_key = 'managecategoriescolumnshidden'
			OR meta_key = 'manageedit-tagscolumnshidden'
			OR meta_key = 'manageeditcolumnshidden'
			OR meta_key = 'categories_per_page'
			OR meta_key = 'edit_tags_per_page'";
		$prefix = $wpdb->esc_like( $wpdb->base_prefix );
		$wpdb->query(
			$wpdb->prepare(
				$sql,
				$prefix . '%' . $wpdb->esc_like( 'meta-box-hidden' ) . '%',
				$prefix . '%' . $wpdb->esc_like( 'closedpostboxes' ) . '%',
				$prefix . '%' . $wpdb->esc_like( 'manage-' ) . '%' . $wpdb->esc_like( '-columns-hidden' ) . '%',
				$prefix . '%' . $wpdb->esc_like( 'meta-box-order' ) . '%',
				$prefix . '%' . $wpdb->esc_like( 'metaboxorder' ) . '%',
				$prefix . '%' . $wpdb->esc_like( 'screen_layout' ) . '%'
			)
		);
	}

}