mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 17:48:01 +01:00
Multisite: Use get_current_blog_id()
in get_site()
for current site.
The global `$current_blog` is not switched in `switch_to_blog()` and can not be used to properly retrieve current switched site information. See #37607. Built from https://develop.svn.wordpress.org/trunk@38217 git-svn-id: http://core.svn.wordpress.org/trunk@38158 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
0ddbc2c99f
commit
b45adc74df
@ -478,15 +478,12 @@ function clean_blog_cache( $blog ) {
|
||||
*
|
||||
* @since 4.6.0
|
||||
*
|
||||
* @global WP_Site $current_blog The current site.
|
||||
*
|
||||
* @param WP_Site|int|null $site Optional. Site to retrieve. Default is the current site.
|
||||
* @return WP_Site|null The site object or null if not found.
|
||||
*/
|
||||
function get_site( &$site = null ) {
|
||||
global $current_blog;
|
||||
if ( empty( $site ) && isset( $current_blog ) ) {
|
||||
$site = $current_blog;
|
||||
if ( empty( $site ) ) {
|
||||
$site = get_current_blog_id();
|
||||
}
|
||||
|
||||
if ( $site instanceof WP_Site ) {
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.7-alpha-38216';
|
||||
$wp_version = '4.7-alpha-38217';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user