mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
In multisite, on the updated_option action, if the option name is one of: 'blogname', 'siteurl', 'post_count' - refresh the blog details cache for the current blog id.
Adds unit test. Props kovshenin. Fixes #26410. git-svn-id: https://develop.svn.wordpress.org/trunk@28881 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1397,6 +1397,19 @@ class Tests_MS extends WP_UnitTestCase {
|
||||
wp_delete_post( $post2 );
|
||||
$this->assertEquals( 1, get_blog_details()->post_count );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 26410
|
||||
*/
|
||||
function test_blog_details_cache_invalidation() {
|
||||
update_option( 'blogname', 'foo' );
|
||||
$details = get_blog_details( get_current_blog_id() );
|
||||
$this->assertEquals( 'foo', $details->blogname );
|
||||
|
||||
update_option( 'blogname', 'bar' );
|
||||
$details = get_blog_details( get_current_blog_id() );
|
||||
$this->assertEquals( 'bar', $details->blogname );
|
||||
}
|
||||
}
|
||||
|
||||
endif;
|
||||
|
||||
Reference in New Issue
Block a user