title: Wordpress - How can i get the current Author data with another Function
body: <p>I wondering of how can i override the $curauth to some function to get the current author data, I searched a lot and tested more and more functions without any success.</p>
  
  <p>I used this line into author.php for sure to get the author by slug or name, So how can i get the same author data with another php function?</p>
  
  <pre><code>&lt;?php
      $curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author));
  ?&gt; 
  </code></pre>
  
  <p>to be more clear..As we know when we need to get some of user meta we get it like so. </p>
  
  <pre><code>$following = get_user_meta($curauth-&gt;ID, '_pwuf_following', true);
  </code></pre>
  
  <p>Now if i have an function and i need to get the same user meta, What should i do.</p>
  
  <p>NOTE: I need to get the user meta to be public for all users not only for current user!</p>
  
  <p>e.g:</p>
  
  <pre><code>function pwuf_following_users () {
  
      $curauth = (...?...);
  
      $following = get_user_meta($curauth-&gt;ID, '_pwuf_following', true);
  
      if ( empty($following)) {
  
          //do something
  
      } else {
  
          //Another awesome something
  
      }
  
  }
  </code></pre>