Hide a event category to user role

Home Forums Calendar Products Events Calendar PRO Hide a event category to user role

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1514680
    Arnaud
    Participant

    Hi,

    I’m trying to hide an event category in month view to a user role with css.

    I add this snippet to my function.php file :

    add_action('init', 'get_current_user_role');
    function get_current_user_role() {
    
        global $current_user;
        $user_role = array_shift($current_user->roles);
        $umrole=um_user('role_name');
    }
    
    // Cacher agenda Admin aux membre
      	
      	if ($umrole="Membres"){
    		echo '<style>.type-tribe_events. tribe-events-category-administration {display: none;}</style>';
    	} else if ($umrole="Administration"){
    		echo '<style>.type-tribe_events. tribe-events-category-administration {display: inline-block;}</style>';
    	}

    This working well when I load my calendar (month view) but when I’m using links to next or previous month the page remains stuck on loader animation.

    If anyone have an idea to help… Thank you !

    #1516187

    Hi Arnaud,

    Thanks so much for reaching out!

    I closed your other thread that was marked as resolved for this issue.

    Has this issue been resolved?

    Let me know!

     

    Thanks,

    Jaime

    #1533079
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Hide a event category to user role’ is closed to new replies.