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

props fliespl.
fixes #22134.


git-svn-id: https://develop.svn.wordpress.org/trunk@26566 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-12-03 17:43:52 +00:00
parent baed9f84fa
commit f627d23555
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();