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
+2 -2
View File
@@ -493,7 +493,7 @@ class WP_User {
*/
public function get_role_caps() {
$switch_site = false;
if ( is_multisite() && $this->site_id != get_current_blog_id() ) {
if ( is_multisite() && get_current_blog_id() != $this->site_id ) {
$switch_site = true;
switch_to_blog( $this->site_id );
@@ -590,7 +590,7 @@ class WP_User {
* @param string $role Role name.
*/
public function set_role( $role ) {
if ( 1 == count( $this->roles ) && $role == current( $this->roles ) ) {
if ( 1 == count( $this->roles ) && current( $this->roles ) == $role ) {
return;
}