Make WordPress Core


Ignore:
Timestamp:
01/15/2022 08:47:06 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison in wp-admin/includes/class-wp-users-list-table.php.

This mirrors a similar check a few lines below and includes minor code layout fixes for better readability.

Follow-up to [9955], [13931], [14176], [15315], [45407], [50129].

See #54728.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-users-list-table.php

    r52426 r52581  
    448448        if ( current_user_can( 'list_users' ) ) {
    449449            // Set up the user editing link.
    450             $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user_object->ID ) ) );
     450            $edit_link = esc_url(
     451                add_query_arg(
     452                    'wp_http_referer',
     453                    urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ),
     454                    get_edit_user_link( $user_object->ID )
     455                )
     456            );
    451457
    452458            if ( current_user_can( 'edit_user', $user_object->ID ) ) {
     
    457463            }
    458464
    459             if ( ! is_multisite() && get_current_user_id() != $user_object->ID && current_user_can( 'delete_user', $user_object->ID ) ) {
     465            if ( ! is_multisite()
     466                && get_current_user_id() !== $user_object->ID
     467                && current_user_can( 'delete_user', $user_object->ID )
     468            ) {
    460469                $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url( "users.php?action=delete&amp;user=$user_object->ID", 'bulk-users' ) . "'>" . __( 'Delete' ) . '</a>';
    461470            }
    462             if ( is_multisite() && current_user_can( 'remove_user', $user_object->ID ) ) {
     471
     472            if ( is_multisite()
     473                && current_user_can( 'remove_user', $user_object->ID )
     474            ) {
    463475                $actions['remove'] = "<a class='submitdelete' href='" . wp_nonce_url( $url . "action=remove&amp;user=$user_object->ID", 'bulk-users' ) . "'>" . __( 'Remove' ) . '</a>';
    464476            }
     
    477489
    478490            // Add a link to send the user a reset password link by email.
    479             if ( get_current_user_id() !== $user_object->ID && current_user_can( 'edit_user', $user_object->ID ) ) {
     491            if ( get_current_user_id() !== $user_object->ID
     492                && current_user_can( 'edit_user', $user_object->ID )
     493            ) {
    480494                $actions['resetpassword'] = "<a class='resetpassword' href='" . wp_nonce_url( "users.php?action=resetpassword&amp;users=$user_object->ID", 'bulk-users' ) . "'>" . __( 'Send password reset' ) . '</a>';
    481495            }
Note: See TracChangeset for help on using the changeset viewer.