Make WordPress Core

Ticket #51379: 51379.4.diff

File 51379.4.diff, 2.2 KB (added by garrett-eclipse, 3 years ago)

One further minor docblock update remove or not as when refering to exists and valid the or not is already inferred.

  • src/wp-includes/user.php

     
    15851585 * Conditional Tags} article in the Theme Developer Handbook.
    15861586 *
    15871587 * @since 2.0.0
     1588 * @since 4.9.0 Introduced `username_exists` filter.
    15881589 *
    1589  * @param string $username Username.
     1590 * @param string $username The username to check for existence.
    15901591 * @return int|false The user's ID on success, and false on failure.
    15911592 */
    15921593function username_exists( $username ) {
     
    15981599        }
    15991600
    16001601        /**
    1601          * Filters whether the given username exists or not.
     1602         * Filters whether the given username exists.
    16021603         *
    16031604         * @since 4.9.0
    16041605         *
    1605          * @param int|false $user_id  The user's ID on success, and false on failure.
     1606         * @param int|false $user_id  The user's ID associated to the username,
     1607         * or false if the username isn't associated to a user.
    16061608         * @param string    $username Username to check.
    16071609         */
    16081610        return apply_filters( 'username_exists', $user_id, $username );
     
    16231625function email_exists( $email ) {
    16241626        $user = get_user_by( 'email', $email );
    16251627        if ( $user ) {
    1626                 return $user->ID;
     1628                $user_id = $user->ID;
     1629        } else {
     1630                $user_id = false;
    16271631        }
    1628         return false;
     1632
     1633        /**
     1634         * Filters whether the given email exists.
     1635         *
     1636         * @since 5.6.0
     1637         *
     1638         * @param int|false $user_id The user's ID on success, and false on failure.
     1639         * @param string    $email   Email.
     1640         */
     1641        return apply_filters( 'email_exists', $user_id, $email );
    16291642}
    16301643
    16311644/**
     
    16421655        $valid     = ( $sanitized == $username && ! empty( $sanitized ) );
    16431656
    16441657        /**
    1645          * Filters whether the provided username is valid or not.
     1658         * Filters whether the provided username is valid.
    16461659         *
    16471660         * @since 2.0.1
    16481661         *
     
    18331846
    18341847        /*
    18351848         * If there is no update, just check for `email_exists`. If there is an update,
    1836          * check if current email and new email are the same, or not, and check `email_exists`
     1849         * check if current email and new email are the same, and check `email_exists`
    18371850         * accordingly.
    18381851         */
    18391852        if ( ( ! $update || ( ! empty( $old_user_data ) && 0 !== strcasecmp( $user_email, $old_user_data->user_email ) ) )