WordPress.org

Make WordPress Core

Changeset 30870 for branches/4.1


Ignore:
Timestamp:
12/15/2014 07:34:16 PM (6 years ago)
Author:
johnbillion
Message:

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.

Location:
branches/4.1
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/4.1

  • branches/4.1/src/wp-admin/includes/class-wp-upgrader.php

    r30762 r30870  
    18461846
    18471847        if ( $parsed_args['clear_update_cache'] ) {
    1848             _wp_clear_update_cache();
     1848            wp_clean_update_cache();
    18491849        }
    18501850
     
    27772777
    27782778            // Clear existing caches
    2779             _wp_clear_update_cache();
     2779            wp_clean_update_cache();
    27802780
    27812781            wp_version_check();  // check for Core updates
  • branches/4.1/src/wp-includes/update.php

    r30696 r30870  
    656656 * @since 4.1.0
    657657 */
    658 function _wp_clear_update_cache() {
     658function wp_clean_update_cache() {
     659    if ( function_exists( 'wp_clean_plugins_cache' ) ) {
     660        wp_clean_plugins_cache();
     661    } else {
     662        delete_site_transient( 'update_plugins' );
     663    }
    659664    wp_clean_plugins_cache();
    660665    wp_clean_themes_cache();
     
    684689add_action( 'upgrader_process_complete', 'wp_update_themes', 10, 0 );
    685690
    686 add_action( 'update_option_WPLANG', '_wp_clear_update_cache' , 10, 0 );
     691add_action( 'update_option_WPLANG', 'wp_clean_update_cache' , 10, 0 );
    687692
    688693add_action( 'wp_maybe_auto_update', 'wp_maybe_auto_update' );
Note: See TracChangeset for help on using the changeset viewer.