Make WordPress Core

Changeset 44597


Ignore:
Timestamp:
01/15/2019 05:37:48 AM (8 years ago)
Author:
pento
Message:

Coding Standards: Move assignments out of conditions in wp-includes/user.php.

Props subrataemfluence.
See #44315.

File:
1 edited

Legend:

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

    r44494 r44597  
    14011401 */
    14021402function username_exists( $username ) {
    1403         if ( $user = get_user_by( 'login', $username ) ) {
     1403        $user = get_user_by( 'login', $username );
     1404        if ( $user ) {
    14041405                $user_id = $user->ID;
    14051406        } else {
    … …  
    14311432 */
    14321433function email_exists( $email ) {
    1433         if ( $user = get_user_by( 'email', $email ) ) {
     1434        $user = get_user_by( 'email', $email );
     1435        if ( $user ) {
    14341436                return $user->ID;
    14351437        }
    … …  
    28242826function new_user_email_admin_notice() {
    28252827        global $pagenow;
    2826         if ( 'profile.php' === $pagenow && isset( $_GET['updated'] ) && $email = get_user_meta( get_current_user_id(), '_new_email', true ) ) {
    2827                 /* translators: %s: New email address */
    2828                 echo '<div class="notice notice-info"><p>' . sprintf( __( 'Your email address has not been updated yet. Please check your inbox at %s for a confirmation email.' ), '<code>' . esc_html( $email['newemail'] ) . '</code>' ) . '</p></div>';
     2828
     2829        if ( 'profile.php' === $pagenow && isset( $_GET['updated'] ) ) {
     2830                $email = get_user_meta( get_current_user_id(), '_new_email', true );
     2831                if ( $email ) {
     2832                        /* translators: %s: New email address */
     2833                        echo '<div class="notice notice-info"><p>' . sprintf( __( 'Your email address has not been updated yet. Please check your inbox at %s for a confirmation email.' ), '<code>' . esc_html( $email['newemail'] ) . '</code>' ) . '</p></div>';
     2834                }
    28292835        }
    28302836}
Note: See TracChangeset for help on using the changeset viewer.