diff --git a/wp-includes/user.php b/wp-includes/user.php index a0e699c2c1..41a83d2422 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -1320,9 +1320,20 @@ function clean_user_cache( $user ) { */ function username_exists( $username ) { if ( $user = get_user_by( 'login', $username ) ) { - return $user->ID; + $user_id = $user->ID; + } else { + $user_id = false; } - return false; + + /** + * Filters whether the given username exists or not. + * + * @since 4.9.0 + * + * @param int|false $user_id The user's ID on success, and false on failure. + * @param string $username Username to check. + */ + return apply_filters( 'username_exists', $user_id, $username ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 6b54f41a38..437cc441ac 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.9-alpha-41157'; +$wp_version = '4.9-alpha-41158'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.