Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set autoload to 'no' for previously activated themes using upgrade routine #5711

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions src/wp-admin/includes/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,10 @@
upgrade_640();
}

if ( $wp_current_db_version < 57200 ) {
upgrade_650();
}

maybe_disable_link_manager();

maybe_disable_automattic_widgets();
Expand Down Expand Up @@ -2349,6 +2353,37 @@
}
}

/**
* 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 < 57200 ) {

Check failure on line 2369 in src/wp-admin/includes/upgrade.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Whitespace found at end of line
mukeshpanchal27 marked this conversation as resolved.
Show resolved Hide resolved
$stylesheet = get_stylesheet();

// Set autoload=no for the previous all themes.
mukeshpanchal27 marked this conversation as resolved.
Show resolved Hide resolved
$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",
felixarntz marked this conversation as resolved.
Show resolved Hide resolved
$wpdb->esc_like( 'theme_mods_' ) . '%'
)
);

$autoload = array_fill_keys( $theme_mods_options, 'no' );
$autoload[ "theme_mods_$stylesheet" ] = 'yes';
mukeshpanchal27 marked this conversation as resolved.
Show resolved Hide resolved
wp_set_option_autoload_values( $autoload );
}
}

/**
* Executes network-level upgrade routines.
*
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*
* @global int $wp_db_version
*/
$wp_db_version = 56657;
$wp_db_version = 57200;

/**
* Holds the TinyMCE version.
Expand Down
Loading