Edit File by line
/home/barbar84/www/wp-admin/includes
File: upgrade.php
KEY category_nicename (category_nicename),
[3500] Fix | Delete
KEY last_updated (last_updated)
[3501] Fix | Delete
) $charset_collate;
[3502] Fix | Delete
";
[3503] Fix | Delete
// Now create tables.
[3504] Fix | Delete
dbDelta( $ms_queries );
[3505] Fix | Delete
}
[3506] Fix | Delete
endif;
[3507] Fix | Delete
[3508] Fix | Delete
/**
[3509] Fix | Delete
* Determine if global tables should be upgraded.
[3510] Fix | Delete
*
[3511] Fix | Delete
* This function performs a series of checks to ensure the environment allows
[3512] Fix | Delete
* for the safe upgrading of global WordPress database tables. It is necessary
[3513] Fix | Delete
* because global tables will commonly grow to millions of rows on large
[3514] Fix | Delete
* installations, and the ability to control their upgrade routines can be
[3515] Fix | Delete
* critical to the operation of large networks.
[3516] Fix | Delete
*
[3517] Fix | Delete
* In a future iteration, this function may use `wp_is_large_network()` to more-
[3518] Fix | Delete
* intelligently prevent global table upgrades. Until then, we make sure
[3519] Fix | Delete
* WordPress is on the main site of the main network, to avoid running queries
[3520] Fix | Delete
* more than once in multi-site or multi-network environments.
[3521] Fix | Delete
*
[3522] Fix | Delete
* @since 4.3.0
[3523] Fix | Delete
*
[3524] Fix | Delete
* @return bool Whether to run the upgrade routines on global tables.
[3525] Fix | Delete
*/
[3526] Fix | Delete
function wp_should_upgrade_global_tables() {
[3527] Fix | Delete
[3528] Fix | Delete
// Return false early if explicitly not upgrading.
[3529] Fix | Delete
if ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
[3530] Fix | Delete
return false;
[3531] Fix | Delete
}
[3532] Fix | Delete
[3533] Fix | Delete
// Assume global tables should be upgraded.
[3534] Fix | Delete
$should_upgrade = true;
[3535] Fix | Delete
[3536] Fix | Delete
// Set to false if not on main network (does not matter if not multi-network).
[3537] Fix | Delete
if ( ! is_main_network() ) {
[3538] Fix | Delete
$should_upgrade = false;
[3539] Fix | Delete
}
[3540] Fix | Delete
[3541] Fix | Delete
// Set to false if not on main site of current network (does not matter if not multi-site).
[3542] Fix | Delete
if ( ! is_main_site() ) {
[3543] Fix | Delete
$should_upgrade = false;
[3544] Fix | Delete
}
[3545] Fix | Delete
[3546] Fix | Delete
/**
[3547] Fix | Delete
* Filters if upgrade routines should be run on global tables.
[3548] Fix | Delete
*
[3549] Fix | Delete
* @since 4.3.0
[3550] Fix | Delete
*
[3551] Fix | Delete
* @param bool $should_upgrade Whether to run the upgrade routines on global tables.
[3552] Fix | Delete
*/
[3553] Fix | Delete
return apply_filters( 'wp_should_upgrade_global_tables', $should_upgrade );
[3554] Fix | Delete
}
[3555] Fix | Delete
[3556] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function