Ticket #26410: 26410.diff
File 26410.diff, 1.9 KB (added by , 11 years ago) |
---|
-
src/wp-includes/ms-blogs.php
264 264 } 265 265 266 266 /** 267 * Refresh blog details when an option is updated. 268 * 269 * @access private 270 */ 271 function _wp_refresh_blog_details_on_updated_option( $option_name ) { 272 $options = array( 'blogname', 'siteurl', 'post_count' ); 273 if ( in_array( $option_name, $options ) ) { 274 refresh_blog_details( get_current_blog_id() ); 275 } 276 } 277 278 /** 267 279 * Update the details for a blog. Updates the blogs table for a given blog id. 268 280 * 269 281 * @since MU -
src/wp-includes/ms-default-filters.php
69 69 remove_filter( 'option_siteurl', '_config_wp_siteurl' ); 70 70 remove_filter( 'option_home', '_config_wp_home' ); 71 71 72 // Some options changes should trigger blog details refresh. 73 add_action( 'updated_option', '_wp_refresh_blog_details_on_updated_option' ); 74 72 75 // If the network upgrade hasn't run yet, assume ms-files.php rewriting is used. 73 76 add_filter( 'default_site_option_ms_files_rewriting', '__return_true' ); 74 77 -
tests/phpunit/tests/ms.php
1385 1385 $GLOBALS['super_admins'] = $old_global; 1386 1386 } 1387 1387 } 1388 1389 /** 1390 * @ticket 26410 1391 */ 1392 function test_blog_details_cache_invalidation() { 1393 update_option( 'blogname', 'foo' ); 1394 $details = get_blog_details( get_current_blog_id() ); 1395 $this->assertEquals( 'foo', $details->blogname ); 1396 1397 update_option( 'blogname', 'bar' ); 1398 $details = get_blog_details( get_current_blog_id() ); 1399 $this->assertEquals( 'bar', $details->blogname ); 1400 } 1388 1401 } 1389 1402 1390 1403 endif;