diff --git a/src/wp-admin/user-edit.php b/src/wp-admin/user-edit.php index 64f81d68bca1..9e6ae4c2785b 100644 --- a/src/wp-admin/user-edit.php +++ b/src/wp-admin/user-edit.php @@ -13,8 +13,9 @@ $user_id = (int) $user_id; $current_user = wp_get_current_user(); + if ( ! defined( 'IS_PROFILE_PAGE' ) ) { - define( 'IS_PROFILE_PAGE', ( $user_id == $current_user->ID ) ); + define( 'IS_PROFILE_PAGE', ( $user_id === $current_user->ID ) ); } if ( ! $user_id && IS_PROFILE_PAGE ) { @@ -93,7 +94,7 @@ */ if ( is_multisite() && ! current_user_can( 'manage_network_users' ) - && $user_id != $current_user->ID + && $user_id !== $current_user->ID && ! apply_filters( 'enable_edit_any_user_configuration', true ) ) { wp_die( __( 'Sorry, you are not allowed to edit this user.' ) ); @@ -166,7 +167,10 @@ $errors = edit_user( $user_id ); // Grant or revoke super admin status if requested. - if ( is_multisite() && is_network_admin() && ! IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && ! isset( $super_admins ) && empty( $_POST['super_admin'] ) == is_super_admin( $user_id ) ) { + if ( is_multisite() && is_network_admin() + && ! IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) + && ! isset( $super_admins ) && empty( $_POST['super_admin'] ) === is_super_admin( $user_id ) + ) { empty( $_POST['super_admin'] ) ? revoke_super_admin( $user_id ) : grant_super_admin( $user_id ); } @@ -508,7 +512,7 @@ ID == $current_user->ID ) : + if ( $profileuser->ID === $current_user->ID ) : ?>

The new address will not become active until confirmed.' ); ?> @@ -517,7 +521,7 @@ endif; $new_email = get_user_meta( $current_user->ID, '_new_email', true ); - if ( $new_email && $new_email['newemail'] != $current_user->user_email && $profileuser->ID == $current_user->ID ) : + if ( $new_email && $new_email['newemail'] !== $current_user->user_email && $profileuser->ID === $current_user->ID ) : ?>

@@ -862,7 +866,7 @@ $output = ''; foreach ( $profileuser->caps as $cap => $value ) { if ( ! $wp_roles->is_role( $cap ) ) { - if ( '' != $output ) { + if ( '' !== $output ) { $output .= ', '; }