title: Not working is_author(get_current_user_id()) in functions wordpress
body: <p>I have problem to apply a post_type for users who have created their post, in theory I found those functions of wordpress, but apparently it does not work</p>
  
  <pre><code>function preview_publish_posts($query) { 
      if( is_user_logged_in() &amp;&amp; is_author(get_current_user_id()) ) {
          $query-&gt;set('post_status', array('publish', 'pending'));
      }
      return $query;
  }
  
  add_filter('pre_get_posts', 'preview_publish_posts');
  </code></pre>
  
  <p>Or it is possible that the function is not valid for calling it from functions.php</p>