daily pastebin goal
32%
SHARE
TWEET

dashboard events list scope

eventsmanager Jun 9th, 2014 442 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. add_action( 'pre_get_posts', 'parse_query_change_scope' );
  2. function parse_query_change_scope($query){
  3.         if( is_admin() ){
  4.                 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'))) ) {
  5.                         if(!empty($_REQUEST['scope'])) :
  6.                                         $scope = $_REQUEST['scope'];
  7.                         else :
  8.                                         $scope = 'all';
  9.                                         $_REQUEST['scope'] = 'all';
  10.                         endif;
  11.                         $query->query_vars['scope'] = $scope;
  12.                 }
  13.                 return $query;
  14.         }
  15. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top