Advertisement
phpface

Untitled

Oct 21st, 2018
399
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.38 KB | None | 0 0
  1. if( ! function_exists( 'videotube_pre_get_author_posts' ) ){
  2.     /**
  3.      * Filter the channel posts
  4.      *
  5.      * @param $query
  6.      */
  7.     function videotube_pre_get_author_posts( $query ) {
  8.         if( $query->is_main_query() && $query->is_author ){
  9.             $query->set( 'post_type', array( 'video', 'post' ) );
  10.         }
  11.     }
  12.     add_action( 'pre_get_posts' , 'videotube_pre_get_author_posts', 100, 1 );
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement