mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +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:
@@ -70,7 +70,7 @@ function edit_user( $user_id = 0 ) {
|
||||
*/
|
||||
if (
|
||||
( is_multisite() && current_user_can( 'manage_network_users' ) ) ||
|
||||
$user_id !== get_current_user_id() ||
|
||||
get_current_user_id() !== $user_id ||
|
||||
( $potential_role && $potential_role->has_cap( 'promote_users' ) )
|
||||
) {
|
||||
$user->role = $new_role;
|
||||
@@ -81,7 +81,7 @@ function edit_user( $user_id = 0 ) {
|
||||
$user->user_email = sanitize_text_field( wp_unslash( $_POST['email'] ) );
|
||||
}
|
||||
if ( isset( $_POST['url'] ) ) {
|
||||
if ( empty( $_POST['url'] ) || $_POST['url'] == 'http://' ) {
|
||||
if ( empty( $_POST['url'] ) || 'http://' === $_POST['url'] ) {
|
||||
$user->user_url = '';
|
||||
} else {
|
||||
$user->user_url = esc_url_raw( $_POST['url'] );
|
||||
@@ -143,7 +143,7 @@ function edit_user( $user_id = 0 ) {
|
||||
$errors = new WP_Error();
|
||||
|
||||
/* checking that username has been typed */
|
||||
if ( $user->user_login == '' ) {
|
||||
if ( '' == $user->user_login ) {
|
||||
$errors->add( 'user_login', __( '<strong>Error</strong>: Please enter a username.' ) );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user