In dbDelta(), ensure we are not running CREATE TABLE queries for global tables we wish to not upgrade.

props fliespl.
fixes #22134.

Built from https://develop.svn.wordpress.org/trunk@26566


git-svn-id: http://core.svn.wordpress.org/trunk@26457 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-12-03 17:44:10 +00:00
parent addc2a8f38
commit a3fba0096d
1 changed files with 3 additions and 1 deletions

View File

@ -1549,8 +1549,10 @@ function dbDelta( $queries = '', $execute = true ) {
$global_tables = $wpdb->tables( 'global' );
foreach ( $cqueries as $table => $qry ) {
// Upgrade global tables only for the main site. Don't upgrade at all if DO_NOT_UPGRADE_GLOBAL_TABLES is defined.
if ( in_array( $table, $global_tables ) && ( !is_main_site() || defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) )
if ( in_array( $table, $global_tables ) && ( !is_main_site() || defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) ) {
unset( $cqueries[ $table ], $for_update[ $table ] );
continue;
}
// Fetch the table column structure from the database
$suppress = $wpdb->suppress_errors();