mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Multisite: Implement the get_by_path method in WP_Network.
Move the internals of `get_network_by_path()` to `WP_Network()` and allow network objects to be retrieved by passing a requested domain and path. Props johnjamesjacoby, jeremyfelt, drewapicture, wonderboymusic. See #31985. git-svn-id: https://develop.svn.wordpress.org/trunk@34099 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -87,7 +87,7 @@ if ( !isset( $current_site ) || !isset( $current_blog ) ) {
|
||||
}
|
||||
}
|
||||
if ( empty( $current_site ) ) {
|
||||
$current_site = get_network_by_path( $domain, $path, 1 );
|
||||
$current_site = WP_Network::get_by_path( $domain, $path, 1 );
|
||||
}
|
||||
|
||||
if ( empty( $current_site ) ) {
|
||||
@@ -118,7 +118,7 @@ if ( !isset( $current_site ) || !isset( $current_blog ) ) {
|
||||
$current_site = WP_Network::get_instance( $current_blog->site_id ? $current_blog->site_id : 1 );
|
||||
} else {
|
||||
// If you don't have a site with the same domain/path as a network, you're pretty screwed, but:
|
||||
$current_site = get_network_by_path( $domain, $path, 1 );
|
||||
$current_site = WP_Network::get_by_path( $domain, $path, 1 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user