Support

Home Forums Event Espresso Premium Admin Event List – Restrict events by categorys

Admin Event List – Restrict events by categorys

Posted: May 26, 2015 at 8:03 am

Viewing 1 reply thread


Zoe E

May 26, 2015 at 8:03 am

Hello,

We need to restrict the kind of events shown to differents roles.

As explained in another post:
https://eventespresso.com/topic/admin-event-list-restrict-events-by-catogrys/

We were recommend to use FHEE__Events_Admin_Page__get_events__where filter hook,

However i am not sure how to integrate this hock to limit depending on what role the users on. if you could give an example on how to do it with everyone i can add the bit which does it for each role.

Many Thanks.


Dean

May 27, 2015 at 3:23 am

Hi,

function by_cat( $where, $this ) {

  //obviously this is not a real IF statement
  $user_role = 'administrator';
  if($user_role = 'administrator') {
      $where['Term_Taxonomy.term_id'] = 17;
  }
  return $where;

} 
add_filter('FHEE__Events_Admin_Page__get_events__where', 'by_cat', 10, 2);

By returning the Category ID in the $where sub array Term_Taxonomy.term_id it will limit the Admin event overview to only events from that category. You CANNOT pass an array it seems.

Viewing 1 reply thread

The support post ‘Admin Event List – Restrict events by categorys’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso