mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
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:
@@ -768,7 +768,7 @@ function is_user_member_of_blog( $user_id = 0, $blog_id = 0 ) {
|
||||
$base_capabilities_key = $wpdb->base_prefix . 'capabilities';
|
||||
$site_capabilities_key = $wpdb->base_prefix . $blog_id . '_capabilities';
|
||||
|
||||
if ( isset( $keys[ $base_capabilities_key ] ) && $blog_id == 1 ) {
|
||||
if ( isset( $keys[ $base_capabilities_key ] ) && 1 == $blog_id ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -902,7 +902,7 @@ function count_users( $strategy = 'time', $site_id = null ) {
|
||||
$result = array();
|
||||
|
||||
if ( 'time' == $strategy ) {
|
||||
if ( is_multisite() && $site_id != get_current_blog_id() ) {
|
||||
if ( is_multisite() && get_current_blog_id() != $site_id ) {
|
||||
switch_to_blog( $site_id );
|
||||
$avail_roles = wp_roles()->get_names();
|
||||
restore_current_blog();
|
||||
@@ -1872,7 +1872,7 @@ function wp_insert_user( $userdata ) {
|
||||
do_action( 'profile_update', $user_id, $old_user_data );
|
||||
|
||||
if ( isset( $userdata['spam'] ) && $userdata['spam'] != $old_user_data->spam ) {
|
||||
if ( $userdata['spam'] == 1 ) {
|
||||
if ( 1 == $userdata['spam'] ) {
|
||||
/**
|
||||
* Fires after the user is marked as a SPAM user.
|
||||
*
|
||||
@@ -2493,7 +2493,7 @@ function register_new_user( $user_login, $user_email ) {
|
||||
$user_email = apply_filters( 'user_registration_email', $user_email );
|
||||
|
||||
// Check the username.
|
||||
if ( $sanitized_user_login == '' ) {
|
||||
if ( '' == $sanitized_user_login ) {
|
||||
$errors->add( 'empty_username', __( '<strong>Error</strong>: Please enter a username.' ) );
|
||||
} elseif ( ! validate_username( $user_login ) ) {
|
||||
$errors->add( 'invalid_username', __( '<strong>Error</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ) );
|
||||
@@ -2510,7 +2510,7 @@ function register_new_user( $user_login, $user_email ) {
|
||||
}
|
||||
|
||||
// Check the email address.
|
||||
if ( $user_email == '' ) {
|
||||
if ( '' == $user_email ) {
|
||||
$errors->add( 'empty_email', __( '<strong>Error</strong>: Please type your email address.' ) );
|
||||
} elseif ( ! is_email( $user_email ) ) {
|
||||
$errors->add( 'invalid_email', __( '<strong>Error</strong>: The email address isn’t correct.' ) );
|
||||
@@ -2677,7 +2677,7 @@ function wp_get_users_with_no_role( $site_id = null ) {
|
||||
|
||||
$prefix = $wpdb->get_blog_prefix( $site_id );
|
||||
|
||||
if ( is_multisite() && $site_id != get_current_blog_id() ) {
|
||||
if ( is_multisite() && get_current_blog_id() != $site_id ) {
|
||||
switch_to_blog( $site_id );
|
||||
$role_names = wp_roles()->get_names();
|
||||
restore_current_blog();
|
||||
|
||||
Reference in New Issue
Block a user