Rename _wp_clear_update_cache() to wp_clean_update_cache().
This makes it match most cache-clearing functions, including the ones it wraps. Also no need for it to be prefixed as "private." wp_clean_plugins_cache() doesn't always exist, so as a quick fix, clear the transient we care to clear. Merges [30856] to the 4.1 branch. Fixes #30369. Built from https://develop.svn.wordpress.org/branches/4.1@30870 git-svn-id: http://core.svn.wordpress.org/branches/4.1@30860 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
709da31957
commit
296a23c662
|
@ -1845,7 +1845,7 @@ class Language_Pack_Upgrader extends WP_Upgrader {
|
||||||
remove_filter( 'upgrader_source_selection', array( $this, 'check_package' ) );
|
remove_filter( 'upgrader_source_selection', array( $this, 'check_package' ) );
|
||||||
|
|
||||||
if ( $parsed_args['clear_update_cache'] ) {
|
if ( $parsed_args['clear_update_cache'] ) {
|
||||||
_wp_clear_update_cache();
|
wp_clean_update_cache();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $results;
|
return $results;
|
||||||
|
@ -2776,7 +2776,7 @@ class WP_Automatic_Updater {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear existing caches
|
// Clear existing caches
|
||||||
_wp_clear_update_cache();
|
wp_clean_update_cache();
|
||||||
|
|
||||||
wp_version_check(); // check for Core updates
|
wp_version_check(); // check for Core updates
|
||||||
wp_update_themes(); // Check for Theme updates
|
wp_update_themes(); // Check for Theme updates
|
||||||
|
|
|
@ -655,7 +655,12 @@ function wp_schedule_update_checks() {
|
||||||
*
|
*
|
||||||
* @since 4.1.0
|
* @since 4.1.0
|
||||||
*/
|
*/
|
||||||
function _wp_clear_update_cache() {
|
function wp_clean_update_cache() {
|
||||||
|
if ( function_exists( 'wp_clean_plugins_cache' ) ) {
|
||||||
|
wp_clean_plugins_cache();
|
||||||
|
} else {
|
||||||
|
delete_site_transient( 'update_plugins' );
|
||||||
|
}
|
||||||
wp_clean_plugins_cache();
|
wp_clean_plugins_cache();
|
||||||
wp_clean_themes_cache();
|
wp_clean_themes_cache();
|
||||||
delete_site_transient( 'update_core' );
|
delete_site_transient( 'update_core' );
|
||||||
|
@ -683,7 +688,7 @@ add_action( 'admin_init', '_maybe_update_themes' );
|
||||||
add_action( 'wp_update_themes', 'wp_update_themes' );
|
add_action( 'wp_update_themes', 'wp_update_themes' );
|
||||||
add_action( 'upgrader_process_complete', 'wp_update_themes', 10, 0 );
|
add_action( 'upgrader_process_complete', 'wp_update_themes', 10, 0 );
|
||||||
|
|
||||||
add_action( 'update_option_WPLANG', '_wp_clear_update_cache' , 10, 0 );
|
add_action( 'update_option_WPLANG', 'wp_clean_update_cache' , 10, 0 );
|
||||||
|
|
||||||
add_action( 'wp_maybe_auto_update', 'wp_maybe_auto_update' );
|
add_action( 'wp_maybe_auto_update', 'wp_maybe_auto_update' );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue