Changeset 28881
- Timestamp:
- 06/28/2014 04:06:12 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/ms-blogs.php
r28835 r28881 265 265 266 266 /** 267 * Refresh blog details when an option is updated. 268 * 269 * @access private 270 * @param string $option_name 271 */ 272 function _wp_refresh_blog_details_on_updated_option( $option_name ) { 273 $options = array( 'blogname', 'siteurl', 'post_count' ); 274 if ( in_array( $option_name, $options ) ) { 275 refresh_blog_details( get_current_blog_id() ); 276 } 277 } 278 279 /** 267 280 * Update the details for a blog. Updates the blogs table for a given blog id. 268 281 * … … 904 917 return; 905 918 } 906 919 907 920 update_posts_count(); 908 921 } -
trunk/src/wp-includes/ms-default-filters.php
r28835 r28881 71 71 remove_filter( 'option_home', '_config_wp_home' ); 72 72 73 // Some options changes should trigger blog details refresh. 74 add_action( 'updated_option', '_wp_refresh_blog_details_on_updated_option' ); 75 73 76 // If the network upgrade hasn't run yet, assume ms-files.php rewriting is used. 74 77 add_filter( 'default_site_option_ms_files_rewriting', '__return_true' ); -
trunk/tests/phpunit/tests/ms.php
r28835 r28881 1398 1398 $this->assertEquals( 1, get_blog_details()->post_count ); 1399 1399 } 1400 1401 /** 1402 * @ticket 26410 1403 */ 1404 function test_blog_details_cache_invalidation() { 1405 update_option( 'blogname', 'foo' ); 1406 $details = get_blog_details( get_current_blog_id() ); 1407 $this->assertEquals( 'foo', $details->blogname ); 1408 1409 update_option( 'blogname', 'bar' ); 1410 $details = get_blog_details( get_current_blog_id() ); 1411 $this->assertEquals( 'bar', $details->blogname ); 1412 } 1400 1413 } 1401 1414
Note: See TracChangeset
for help on using the changeset viewer.