Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
* @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
You can’t perform that action at this time.