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 !