From 120710d8f85417d732baa1b9cd42b8204d01d226 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Tue, 15 Jan 2019 05:38:49 +0000 Subject: [PATCH] Coding Standards: Move assignments out of conditions in `wp-includes/user.php`. Props subrataemfluence. See #44315. Built from https://develop.svn.wordpress.org/trunk@44597 git-svn-id: http://core.svn.wordpress.org/trunk@44428 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/user.php | 16 +++++++++++----- wp-includes/version.php | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/wp-includes/user.php b/wp-includes/user.php index 6415d95c33..4c14aa6451 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -1400,7 +1400,8 @@ function clean_user_cache( $user ) { * @return int|false The user's ID on success, and false on failure. */ function username_exists( $username ) { - if ( $user = get_user_by( 'login', $username ) ) { + $user = get_user_by( 'login', $username ); + if ( $user ) { $user_id = $user->ID; } else { $user_id = false; @@ -1430,7 +1431,8 @@ function username_exists( $username ) { * @return int|false The user's ID on success, and false on failure. */ function email_exists( $email ) { - if ( $user = get_user_by( 'email', $email ) ) { + $user = get_user_by( 'email', $email ); + if ( $user ) { return $user->ID; } return false; @@ -2823,9 +2825,13 @@ All at ###SITENAME### */ function new_user_email_admin_notice() { global $pagenow; - if ( 'profile.php' === $pagenow && isset( $_GET['updated'] ) && $email = get_user_meta( get_current_user_id(), '_new_email', true ) ) { - /* translators: %s: New email address */ - echo '

' . sprintf( __( 'Your email address has not been updated yet. Please check your inbox at %s for a confirmation email.' ), '' . esc_html( $email['newemail'] ) . '' ) . '

'; + + if ( 'profile.php' === $pagenow && isset( $_GET['updated'] ) ) { + $email = get_user_meta( get_current_user_id(), '_new_email', true ); + if ( $email ) { + /* translators: %s: New email address */ + echo '

' . sprintf( __( 'Your email address has not been updated yet. Please check your inbox at %s for a confirmation email.' ), '' . esc_html( $email['newemail'] ) . '' ) . '

'; + } } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 9f89182386..d21202f093 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.1-beta1-44596'; +$wp_version = '5.1-beta1-44597'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.