• Hi graphicgeek!

    I’m using your great plugin, goes really well on my website! However, I created different users with different content permissions and I have public and private events which may or may not be seen by different users. Is there a way to control which type of events a specific user can see? For user permission control I’m using Eyes Only and Press Permit Core plugins. Any tips?

    Thank you!

    https://www.ads-software.com/plugins/event-geek/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter jcpcosta

    (@jcpcosta)

    Plugin Author graphicgeek

    (@graphicgeek)

    I think it might be possible, but it’s going to require some coding. Are you comfortable using WordPress hooks?

    Thread Starter jcpcosta

    (@jcpcosta)

    Sometimes I am ?? I think It won’t be a problem,

    Plugin Author graphicgeek

    (@graphicgeek)

    I think you could use event categories to specify which events were for which type of user, and then use the gg_event_widget_date_args hook to do something like this:

    function my_event_dates_filter($args){
    	$category = get_user_category();//you will need to write this function to return the category slug the user is allowed to see (or return false).
    
    	if($category){
    	$args['event_category'] = $category;
    	}
    
    	return $args;
    }
    
    add_filter('gg_event_widget_date_args', 'my_event_dates_filter');

    That should make it so that the widget will only display events in the category for that user.

    Then on your event listing page, you could use the template tag like this:

    $category = get_user_category();
    $args = array();
    if($category){
    	$args['category'] = $category;
    }
    
    event_geek_list($args);
    Plugin Author graphicgeek

    (@graphicgeek)

    I think you could use event categories to specify which events were for which type of user, and then use the gg_event_widget_date_args hook to do something like this:

    function my_event_dates_filter($args){
    	$category = get_user_category();//you will need to write this function to return the category slug the user is allowed to see (or return false).
    
    	if($category){
    	$args['event_category'] = $category;
    	}
    
    	return $args;
    }
    
    add_filter('gg_event_widget_date_args', 'my_event_dates_filter');

    That should make it so that the widget will only display events in the category for that user.

    Then on your event listing page, you could use the template tag like this:

    $category = get_user_category();
    $args = array();
    if($category){
    	$args['category'] = $category;
    }
    
    event_geek_list($args);
    Thread Starter jcpcosta

    (@jcpcosta)

    Hi graphicgeek!

    I’m trying to put this to work. Just one question: when you say to use this piece of code (the 2nd one) on the event listing page you mean directly on the page, through page editing? I’m reading about template tags but I’m not reaching it.

    Thank you.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘restrict events based on type of user’ is closed to new replies.