diff --git a/wp-admin/includes/class-wp-upgrader.php b/wp-admin/includes/class-wp-upgrader.php index 3a3cd69dc0..cfb2e3ab40 100644 --- a/wp-admin/includes/class-wp-upgrader.php +++ b/wp-admin/includes/class-wp-upgrader.php @@ -1372,9 +1372,7 @@ class Language_Pack_Upgrader extends WP_Upgrader { remove_filter( 'upgrader_source_selection', array( $this, 'check_package' ) ); if ( $parsed_args['clear_update_cache'] ) { - wp_clean_themes_cache( true ); - wp_clean_plugins_cache( true ); - delete_site_transient( 'update_core' ); + _wp_clear_update_cache(); } return $results; @@ -2217,9 +2215,7 @@ class WP_Automatic_Updater { } // Clear existing caches - wp_clean_plugins_cache(); - wp_clean_themes_cache(); - delete_site_transient( 'update_core' ); + _wp_clear_update_cache(); wp_version_check(); // check for Core updates wp_update_themes(); // Check for Theme updates diff --git a/wp-includes/update.php b/wp-includes/update.php index bb3b100935..9a46823ce4 100644 --- a/wp-includes/update.php +++ b/wp-includes/update.php @@ -648,8 +648,20 @@ function wp_schedule_update_checks() { } } -if ( ( ! is_main_site() && ! is_network_admin() ) || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) +/** + * Clear existing update caches for plugins, themes, and core. + * + * @since 4.1.0 + */ +function _wp_clear_update_cache() { + wp_clean_plugins_cache(); + wp_clean_themes_cache(); + delete_site_transient( 'update_core' ); +} + +if ( ( ! is_main_site() && ! is_network_admin() ) || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) { return; +} add_action( 'admin_init', '_maybe_update_core' ); add_action( 'wp_version_check', 'wp_version_check' ); @@ -669,6 +681,8 @@ add_action( 'admin_init', '_maybe_update_themes' ); add_action( 'wp_update_themes', 'wp_update_themes' ); add_action( 'upgrader_process_complete', 'wp_update_themes', 10, 0 ); +add_action( 'update_option_WPLANG', '_wp_clear_update_cache' , 10, 0 ); + add_action( 'wp_maybe_auto_update', 'wp_maybe_auto_update' ); add_action('init', 'wp_schedule_update_checks'); diff --git a/wp-includes/version.php b/wp-includes/version.php index 70f6187b5e..0a9b0e619d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.1-beta2-30553'; +$wp_version = '4.1-beta2-30554'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.