Advertisements

upgrade_300

Definition:
function upgrade_300() {}

Execute changes made in WordPress 3.0.

Source code

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-alpha nav menu postmeta changes. can be removed before release. // r13802

	if ( $wp_current_db_version >= 13226 && $wp_current_db_version < 13974 )

		$wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key IN( 'menu_type', 'object_id', 'menu_new_window', 'menu_link', '_menu_item_append', 'menu_item_append', 'menu_item_type', 'menu_item_object_id', 'menu_item_target', 'menu_item_classes', 'menu_item_xfn', 'menu_item_url' )" );



	// 3.0-beta1 remove_user primitive->meta cap. can be removed before release. r13956

	if ( $wp_current_db_version >= 12751 && $wp_current_db_version < 13974 ) {

		$role =& get_role( 'administrator' );

		if ( ! empty( $role ) )

			$role->remove_cap( 'remove_user' );

	}



	// 3.0-beta1 nav menu postmeta changes. can be removed before release. r13974

	if ( $wp_current_db_version >= 13802 && $wp_current_db_version < 13974 )

		$wpdb->update( $wpdb->postmeta, array( 'meta_value' => '' ), array( 'meta_key' => '_menu_item_target', 'meta_value' => '_self' ) );



	// 3.0 screen options key name changes.

	if ( is_main_site() && !defined('DO_NOT_UPGRADE_GLOBAL_TABLES') ) {

		$prefix = like_escape($wpdb->base_prefix);

		$wpdb->query( "DELETE FROM $wpdb->usermeta WHERE meta_key LIKE '{$prefix}%meta-box-hidden%' OR meta_key LIKE '{$prefix}%closedpostboxes%' OR meta_key LIKE '{$prefix}%manage-%-columns-hidden%' OR meta_key LIKE '{$prefix}%meta-box-order%' OR meta_key LIKE '{$prefix}%metaboxorder%' OR meta_key LIKE '{$prefix}%screen_layout%'

3249

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: