Make WordPress Core

Changeset 52687


Ignore:
Timestamp:
02/07/2022 02:45:11 PM (2 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison in wp-admin/user-edit.php.

Follow-up to [2872], [13941], [12722], [14043], [14802], [23364], [42688].

Props azouamauriac.
See #54728.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/user-edit.php

    r52398 r52687  
    1414$user_id      = (int) $user_id;
    1515$current_user = wp_get_current_user();
     16
    1617if ( ! defined( 'IS_PROFILE_PAGE' ) ) {
    17     define( 'IS_PROFILE_PAGE', ( $user_id == $current_user->ID ) );
     18    define( 'IS_PROFILE_PAGE', ( $user_id === $current_user->ID ) );
    1819}
    1920
     
    9495if ( is_multisite()
    9596    && ! current_user_can( 'manage_network_users' )
    96     && $user_id != $current_user->ID
     97    && $user_id !== $current_user->ID
    9798    && ! apply_filters( 'enable_edit_any_user_configuration', true )
    9899) {
     
    167168
    168169        // Grant or revoke super admin status if requested.
    169         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 ) ) {
     170        if ( is_multisite() && is_network_admin()
     171            && ! IS_PROFILE_PAGE && current_user_can( 'manage_network_options' )
     172            && ! isset( $super_admins ) && empty( $_POST['super_admin'] ) === is_super_admin( $user_id )
     173        ) {
    170174            empty( $_POST['super_admin'] ) ? revoke_super_admin( $user_id ) : grant_super_admin( $user_id );
    171175        }
     
    509513        <td><input type="email" name="email" id="email" aria-describedby="email-description" value="<?php echo esc_attr( $profileuser->user_email ); ?>" class="regular-text ltr" />
    510514        <?php
    511         if ( $profileuser->ID == $current_user->ID ) :
     515        if ( $profileuser->ID === $current_user->ID ) :
    512516            ?>
    513517        <p class="description" id="email-description">
     
    518522
    519523        $new_email = get_user_meta( $current_user->ID, '_new_email', true );
    520         if ( $new_email && $new_email['newemail'] != $current_user->user_email && $profileuser->ID == $current_user->ID ) :
     524        if ( $new_email && $new_email['newemail'] !== $current_user->user_email && $profileuser->ID === $current_user->ID ) :
    521525            ?>
    522526        <div class="updated inline">
     
    863867            foreach ( $profileuser->caps as $cap => $value ) {
    864868                if ( ! $wp_roles->is_role( $cap ) ) {
    865                     if ( '' != $output ) {
     869                    if ( '' !== $output ) {
    866870                        $output .= ', ';
    867871                    }
Note: See TracChangeset for help on using the changeset viewer.