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:
parent
addc2a8f38
commit
a3fba0096d
|
@ -1549,8 +1549,10 @@ function dbDelta( $queries = '', $execute = true ) {
|
||||||
$global_tables = $wpdb->tables( 'global' );
|
$global_tables = $wpdb->tables( 'global' );
|
||||||
foreach ( $cqueries as $table => $qry ) {
|
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.
|
// 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;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Fetch the table column structure from the database
|
// Fetch the table column structure from the database
|
||||||
$suppress = $wpdb->suppress_errors();
|
$suppress = $wpdb->suppress_errors();
|
||||||
|
|
Loading…
Reference in New Issue