I would highly recommend Daniel’s much simpler solution

4. maaliskuuta 2015 klo 17.38
Sijainti: Muut: Stack Exchange
Avainsanat: WordPress

I would highly recommend Daniel’s much simpler solution over the one currently selected as correct:

$user = get_userdata( $user_id );
if ( $user == false ) {
    //user id does not exist
} else {
    //user id exists
}

Vastaa viestiin sen kontekstissa (Stack Exchange)