eventsmanager

dashboard events list scope

Jun 9th, 2014
545
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

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×