执行WordPress 3.4中所做的更改。

原型

upgrade_340()

源文件

路径:wp-admin/includes/upgrade.php

<?php
...
	// 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'   ) . '%'
		) );
	}
...
?>

其他

英文文档:https://developer.wordpress.org/reference/functions/upgrade_340/