Support

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

Admin Event List – Restrict events by catogrys

Posted: December 22, 2014 at 7:21 am

Viewing 1 reply thread


Zoe E

December 22, 2014 at 7:21 am

Hello,

I am Looking to limit what events people see depending on there user role and what category the event is part of.

I can do this with normal custom post types by doing the following code:


$roles = appthemes_check_user_role();
		if (in_array('training', $roles)){
	    	global $wpdb;
			$sql = " AND (ID IN (select object_id from wp_term_relationships where term_taxonomy_id IN (23)) OR ($wpdb->posts.post_author IN (SELECT user_id FROM $wpdb->usermeta WHERE meta_key =  'wp_capabilities' AND meta_value LIKE '%training%')))" . $sql;
		}

that is added to word press in the following filter:


add_filter('posts_where', 'my_posts_where_filter');

which adds the sql query and statement to the end of the post sql.

What i am wondering is how what what hook is available in event espresso, So i can do the same thing? as it does not seam to work.

And if not is it possible to be added really soon?


Josh

  • Support Staff

December 23, 2014 at 12:48 pm

Hi there,

I can recommend looking at the FHEE__Events_Admin_Page__get_events__where filter hook found in /event-espresso-core-reg/caffeinated/admin/extend/events/Extend_Events_Admin_Page.core.php.

Viewing 1 reply thread

The support post ‘Admin Event List – Restrict events by catogrys’ 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