Created
March 29, 2020 18:23
-
-
Save kellenmace/6d5533ca07f770bae38c740bf1046a93 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @param int $user_id User ID. | |
* | |
* @return bool Whether the user exists. | |
*/ | |
function does_user_exist( int $user_id ) : bool { | |
return (bool) get_users( [ 'include' => $user_id, 'fields' => 'ID' ] ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment