Coding Standards: Use Yoda conditions where appropriate.

See #49222.

git-svn-id: https://develop.svn.wordpress.org/trunk@47219 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2020-02-09 16:52:28 +00:00
parent 40ffe0ef06
commit 130751cda3
124 changed files with 554 additions and 554 deletions

View File

@@ -27,7 +27,7 @@ if ( isset( $_GET['action'] ) ) {
check_admin_referer( 'deleteuser' );
$id = intval( $_GET['id'] );
if ( $id != '0' && $id != '1' ) {
if ( '0' != $id && '1' != $id ) {
$_POST['allusers'] = array( $id ); // confirm_delete_users() can only handle arrays.
$title = __( 'Users' );
$parent_file = 'users.php';
@@ -49,7 +49,7 @@ if ( isset( $_GET['action'] ) ) {
if ( ( isset( $_POST['action'] ) || isset( $_POST['action2'] ) ) && isset( $_POST['allusers'] ) ) {
check_admin_referer( 'bulk-users-network' );
$doaction = $_POST['action'] != -1 ? $_POST['action'] : $_POST['action2'];
$doaction = -1 != $_POST['action'] ? $_POST['action'] : $_POST['action2'];
$userfunction = '';
foreach ( (array) $_POST['allusers'] as $user_id ) {
@@ -84,7 +84,7 @@ if ( isset( $_GET['action'] ) ) {
$blogs = get_blogs_of_user( $user_id, true );
foreach ( (array) $blogs as $details ) {
if ( $details->userblog_id != get_network()->site_id ) { // Main blog is not a spam!
if ( get_network()->site_id != $details->userblog_id ) { // Main blog is not a spam!
update_blog_status( $details->userblog_id, 'spam', '1' );
}
}
@@ -176,7 +176,7 @@ if ( isset( $_GET['action'] ) ) {
}
}
if ( $i == 1 ) {
if ( 1 == $i ) {
$deletefunction = 'delete';
} else {
$deletefunction = 'all_delete';
@@ -239,7 +239,7 @@ get_current_screen()->set_screen_reader_content(
require_once ABSPATH . 'wp-admin/admin-header.php';
if ( isset( $_REQUEST['updated'] ) && $_REQUEST['updated'] == 'true' && ! empty( $_REQUEST['action'] ) ) {
if ( isset( $_REQUEST['updated'] ) && 'true' == $_REQUEST['updated'] && ! empty( $_REQUEST['action'] ) ) {
?>
<div id="message" class="updated notice is-dismissible"><p>
<?php