Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action( 'pre_get_posts', 'parse_query_change_scope' );
- function parse_query_change_scope($query){
- if( is_admin() ){
- if( !empty($query->query_vars['post_type']) && ($query->query_vars['post_type'] == EM_POST_TYPE_EVENT || $query->query_vars['post_type'] == 'event-recurring') && (empty($query->query_vars['post_status']) || !in_array($query->query_vars['post_status'],array('trash','pending','draft'))) ) {
- if(!empty($_REQUEST['scope'])) :
- $scope = $_REQUEST['scope'];
- else :
- $scope = 'all';
- $_REQUEST['scope'] = 'all';
- endif;
- $query->query_vars['scope'] = $scope;
- }
- return $query;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement