Multisite: Fix coding standard errors after [43654].

See #41333.

Built from https://develop.svn.wordpress.org/trunk@43655


git-svn-id: http://core.svn.wordpress.org/trunk@43484 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Felix Arntz 2018-09-24 15:22:24 +00:00
parent 2b10923a28
commit a58654d87e
2 changed files with 13 additions and 11 deletions

View File

@ -58,7 +58,7 @@ function get_blogaddress_by_id( $blog_id ) {
*/ */
function get_blogaddress_by_name( $blogname ) { function get_blogaddress_by_name( $blogname ) {
if ( is_subdomain_install() ) { if ( is_subdomain_install() ) {
if ( $blogname == 'main' ) { if ( 'main' === $blogname ) {
$blogname = 'www'; $blogname = 'www';
} }
$url = rtrim( network_home_url(), '/' ); $url = rtrim( network_home_url(), '/' );
@ -178,12 +178,12 @@ function get_blog_details( $fields = null, $get_all = true ) {
$blog_id = (int) $blog_id; $blog_id = (int) $blog_id;
$all = $get_all == true ? '' : 'short'; $all = $get_all ? '' : 'short';
$details = wp_cache_get( $blog_id . $all, 'blog-details' ); $details = wp_cache_get( $blog_id . $all, 'blog-details' );
if ( $details ) { if ( $details ) {
if ( ! is_object( $details ) ) { if ( ! is_object( $details ) ) {
if ( $details == -1 ) { if ( -1 == $details ) {
return false; return false;
} else { } else {
// Clear old pre-serialized objects. Cache clients do better with that. // Clear old pre-serialized objects. Cache clients do better with that.
@ -203,7 +203,7 @@ function get_blog_details( $fields = null, $get_all = true ) {
// If short was requested and full cache is set, we can return. // If short was requested and full cache is set, we can return.
if ( $details ) { if ( $details ) {
if ( ! is_object( $details ) ) { if ( ! is_object( $details ) ) {
if ( $details == -1 ) { if ( -1 == $details ) {
return false; return false;
} else { } else {
// Clear old pre-serialized objects. Cache clients do better with that. // Clear old pre-serialized objects. Cache clients do better with that.
@ -1175,10 +1175,12 @@ function wp_uninitialize_site( $site_id ) {
return new WP_Error( 'site_already_uninitialized', __( 'The site appears to be already uninitialized.' ) ); return new WP_Error( 'site_already_uninitialized', __( 'The site appears to be already uninitialized.' ) );
} }
$users = get_users( array( $users = get_users(
'blog_id' => $site->id, array(
'fields' => 'ids', 'blog_id' => $site->id,
) ); 'fields' => 'ids',
)
);
// Remove users from the site. // Remove users from the site.
if ( ! empty( $users ) ) { if ( ! empty( $users ) ) {
@ -1229,7 +1231,7 @@ function wp_uninitialize_site( $site_id ) {
// Get indexed directory from stack // Get indexed directory from stack
$dir = $stack[ $index ]; $dir = $stack[ $index ];
// phpcs:disable Generic.PHP.NoSilencedErrors.Discouraged // phpcs:disable WordPress.PHP.NoSilencedErrors.Discouraged
$dh = @opendir( $dir ); $dh = @opendir( $dir );
if ( $dh ) { if ( $dh ) {
$file = @readdir( $dh ); $file = @readdir( $dh );
@ -1259,7 +1261,7 @@ function wp_uninitialize_site( $site_id ) {
} }
} }
// phpcs:enable Generic.PHP.NoSilencedErrors.Discouraged // phpcs:enable WordPress.PHP.NoSilencedErrors.Discouraged
if ( $switch ) { if ( $switch ) {
restore_current_blog(); restore_current_blog();
} }

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.0-alpha-43654'; $wp_version = '5.0-alpha-43655';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.