Make WordPress Core

Ticket #40201: 40201.2.patch

File 40201.2.patch, 954 bytes (added by spacedmonkey, 8 years ago)
  • src/wp-includes/ms-blogs.php

     
    445445 *
    446446 * @global bool $_wp_suspend_cache_invalidation
    447447 *
    448  * @param WP_Site $blog The site object to be cleared from cache.
     448 * @param WP_Site|int $blog The site object to be cleared from cache.
    449449 */
    450450function clean_blog_cache( $blog ) {
    451451        global $_wp_suspend_cache_invalidation;
     
    454454                return;
    455455        }
    456456
     457        if ( is_object( $blog ) || is_int( $blog ) ) {
     458                $blog = get_site( $blog );
     459        }
     460
     461        if ( ! ( $blog instanceof WP_Site ) ) {
     462                return false;
     463        }
     464
    457465        $blog_id = $blog->blog_id;
    458466        $domain_path_key = md5( $blog->domain . $blog->path );
    459467
     
    478486        do_action( 'clean_site_cache', $blog_id, $blog, $domain_path_key );
    479487
    480488        wp_cache_set( 'last_changed', microtime(), 'sites' );
     489       
     490        return true;
    481491}
    482492
    483493/**