Ticket #40247: 40247.diff
| File 40247.diff, 1.5 KB (added by , 9 years ago) |
|---|
-
src/wp-includes/class-wp-site.php
333 333 $details->home = get_option( 'home' ); 334 334 restore_current_blog(); 335 335 336 $cache_details = true; 337 foreach ( array( 'blogname', 'siteurl', 'post_count', 'home' ) as $field ) { 338 if ( false === $details->$field ) { 339 $cache_details = false; 340 break; 341 } 342 } 343 344 if ( $cache_details ) { 345 wp_cache_set( $this->blog_id, $details, 'site-details' ); 346 } 336 wp_cache_set( $this->blog_id, $details, 'site-details' ); 347 337 } 348 338 349 339 /** This filter is documented in wp-includes/ms-blogs.php */ -
tests/phpunit/tests/multisite/siteDetails.php
125 125 126 126 $this->assertNotFalse( $cached_result ); 127 127 } 128 129 /** 130 * @ticket 40247 131 */ 132 public function test_site_details_cached_including_false_values() { 133 $id = self::factory()->blog->create(); 134 135 $site = get_site( $id ); 136 137 // Trigger retrieving site details (post_count is not set on new sites) 138 $post_count = $site->post_count; 139 140 $cached_details = wp_cache_get( $site->id, 'site-details' ); 141 142 wpmu_delete_blog( $id, true ); 143 wp_update_network_site_counts(); 144 145 $this->assertNotFalse( $cached_details ); 146 } 128 147 } 129 148 130 149 endif;