Ticket #40201: 40201.3.diff
File 40201.3.diff, 2.0 KB (added by , 7 years ago) |
---|
-
src/wp-includes/ms-blogs.php
265 265 $blog_id = get_current_blog_id(); 266 266 } 267 267 268 $details = get_site( $blog_id ); 269 if ( ! $details ) { 270 // Make sure clean_blog_cache() gets the blog ID 271 // when the blog has been previously cached as 272 // non-existent. 273 $details = (object) array( 274 'blog_id' => $blog_id, 275 'domain' => null, 276 'path' => null 277 ); 278 } 279 280 clean_blog_cache( $details ); 281 282 /** 283 * Fires after the blog details cache is cleared. 284 * 285 * @since 3.4.0 286 * 287 * @param int $blog_id Blog ID. 288 */ 289 do_action( 'refresh_blog_details', $blog_id ); 268 clean_blog_cache( $blog_id ); 290 269 } 291 270 292 271 /** … … 443 422 * 444 423 * @global bool $_wp_suspend_cache_invalidation 445 424 * 446 * @param WP_Site $blog The site objectto be cleared from cache.425 * @param WP_Site|int $blog The site object or ID to be cleared from cache. 447 426 */ 448 427 function clean_blog_cache( $blog ) { 449 428 global $_wp_suspend_cache_invalidation; … … 452 431 return; 453 432 } 454 433 434 if ( empty( $blog ) ) { 435 return; 436 } 437 438 $blog_id = $blog; 439 $blog = get_site( $blog_id ); 440 if ( ! $blog ) { 441 if ( ! is_numeric( $blog_id ) ) { 442 return; 443 } 444 445 // Make sure a WP_Site object exists even when the site has been deleted. 446 $blog = new WP_Site( (object) array( 447 'blog_id' => $blog_id, 448 'domain' => null, 449 'path' => null, 450 ) ); 451 } 452 455 453 $blog_id = $blog->blog_id; 456 454 $domain_path_key = md5( $blog->domain . $blog->path ); 457 455 … … 476 474 do_action( 'clean_site_cache', $blog_id, $blog, $domain_path_key ); 477 475 478 476 wp_cache_set( 'last_changed', microtime(), 'sites' ); 477 478 /** 479 * Fires after the blog details cache is cleared. 480 * 481 * @since 3.4.0 482 * @deprecated 4.9.0 Use clean_site_cache 483 * 484 * @param int $blog_id Blog ID. 485 */ 486 do_action_deprecated( 'refresh_blog_details', array( $blog_id ), '4.9.0', 'clean_site_cache' ); 479 487 } 480 488 481 489 /**