WordPress Version: 6.5
/**
* Executes changes made in WordPress 6.5.0.
*
* @ignore
* @since 6.5.0
*
* @global int $wp_current_db_version The old (current) database version.
* @global wpdb $wpdb WordPress database abstraction object.
*/
function upgrade_650()
{
global $wp_current_db_version, $wpdb;
if ($wp_current_db_version < 57155) {
$stylesheet = get_stylesheet();
// Set autoload=no for all themes except the current one.
$theme_mods_options = $wpdb->get_col($wpdb->prepare("SELECT option_name FROM {$wpdb->options} WHERE autoload = 'yes' AND option_name != %s AND option_name LIKE %s", "theme_mods_{$stylesheet}", $wpdb->esc_like('theme_mods_') . '%'));
$autoload = array_fill_keys($theme_mods_options, 'no');
wp_set_option_autoload_values($autoload);
}
}