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 :
// Hide administration category to members
add_action(‘init’, ‘get_current_user_role’);
function get_current_user_role() {
global $current_user;
$user_role = array_shift($current_user->roles);
}
if ($user_role=”um_membres”){
echo “<style>.tribe-events-category-administration {display: none;}</style>”;
} if ($umrole=”um_administration”){
echo “<style>.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 !