Skip to content

Commit

Permalink
Use WP_Site_Alias::get_by_domain() in drop-in sunrise.php.
Browse files Browse the repository at this point in the history
  • Loading branch information
JJJ committed Dec 7, 2016
1 parent 9164c34 commit 95e6988
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions wp-site-aliases/drop-ins/sunrise.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* If your installation does not have a file in 'wp-content/sunrise.php' you'll
* want to copy this file to that location.
*
* Eitherway, make sure you add the following line to your 'wp-config.php':
* Either way, make sure you add the following line to your 'wp-config.php':
*
* define( 'SUNRISE', true );
*/
Expand Down Expand Up @@ -74,19 +74,13 @@ function wp_site_aliases_maybe_load_current_site_and_network() {
}

// Look for an alias
$aliases = new WP_Site_Alias_Query( array(
'domain' => $domain,
'number' => 1
) );
$alias = WP_Site_Alias::get_by_domain( $domain );

// Bail if alias
if ( empty( $aliases->aliases ) || empty( $aliases->found_site_aliases ) ) {
if ( empty( $alias ) ) {
return;
}

// Get the alias that was found
$alias = reset( $aliases->aliases );

// Bail if alias is not active
if ( 'active' !== $alias->status ) {
return;
Expand Down

0 comments on commit 95e6988

Please sign in to comment.