mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Multisite: Use get_sites() instead of a database lookup in get_id_from_blogname().
Because queries generated via `get_sites()` are cached, we can remove the `get_id_from_blogname` cache key. Props flixos90. Fixes #38175. git-svn-id: https://develop.svn.wordpress.org/trunk@38659 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -87,10 +87,6 @@ class Tests_Multisite_Site extends WP_UnitTestCase {
|
||||
|
||||
$this->assertEquals( $details, wp_cache_get( $blog_id . 'short', 'blog-details' ) );
|
||||
|
||||
// get_id_from_blogname(), see #20950
|
||||
$this->assertEquals( $blog_id, get_id_from_blogname( $details->path ) );
|
||||
$this->assertEquals( $blog_id, wp_cache_get( 'get_id_from_blogname_' . trim( $details->path, '/' ), 'blog-details' ) );
|
||||
|
||||
// get_blogaddress_by_name()
|
||||
$this->assertEquals( 'http://' . $details->domain . $details->path, get_blogaddress_by_name( trim( $details->path, '/' ) ) );
|
||||
|
||||
@@ -138,7 +134,6 @@ class Tests_Multisite_Site extends WP_UnitTestCase {
|
||||
// Delete the site without forcing a table drop.
|
||||
wpmu_delete_blog( $blog_id, false );
|
||||
|
||||
$this->assertEquals( false, wp_cache_get( 'get_id_from_blogname_' . trim( $details->path, '/' ), 'blog-details' ) );
|
||||
$this->assertEquals( false, wp_cache_get( $blog_id, 'blog-details' ) );
|
||||
$this->assertEquals( false, wp_cache_get( $blog_id . 'short', 'blog-details' ) );
|
||||
$this->assertEquals( false, wp_cache_get( $key, 'blog-lookup' ) );
|
||||
@@ -177,7 +172,6 @@ class Tests_Multisite_Site extends WP_UnitTestCase {
|
||||
// Delete the site and force a table drop.
|
||||
wpmu_delete_blog( $blog_id, true );
|
||||
|
||||
$this->assertEquals( false, wp_cache_get( 'get_id_from_blogname_' . trim( $details->path, '/' ), 'blog-details' ) );
|
||||
$this->assertEquals( false, wp_cache_get( $blog_id, 'blog-details' ) );
|
||||
$this->assertEquals( false, wp_cache_get( $blog_id . 'short', 'blog-details' ) );
|
||||
$this->assertEquals( false, wp_cache_get( $key, 'blog-lookup' ) );
|
||||
@@ -216,7 +210,6 @@ class Tests_Multisite_Site extends WP_UnitTestCase {
|
||||
// Delete the site and force a table drop.
|
||||
wpmu_delete_blog( $blog_id, true );
|
||||
|
||||
$this->assertEquals( false, wp_cache_get( 'get_id_from_blogname_' . trim( $details->path, '/' ), 'blog-details' ) );
|
||||
$this->assertEquals( false, wp_cache_get( $blog_id, 'blog-details' ) );
|
||||
$this->assertEquals( false, wp_cache_get( $blog_id . 'short', 'blog-details' ) );
|
||||
$this->assertEquals( false, wp_cache_get( $key, 'blog-lookup' ) );
|
||||
|
||||
Reference in New Issue
Block a user