I am looking for a function to check if a user is logged into wordpress via their id.
i am aware of this function.
if ( is_user_logged_in() ) {
echo 'Welcome, registered user!';
} else {
echo 'Welcome, visitor!';
}
but i was wondering if their is a function that does it via id so it would be like the following below.
if ( is_user_logged_in(1) ) {
echo 'this user is logged in';
}
cant find one anywhere.