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