#4827
ArieHeij
Participant

Hi Vladimir,

Thanks for the support, it works great. Just for my state of mind i added another user role like this, I think I did it correct as everything worked. Can you say if I did it correctly? Thanks.

// User role editor pro – Show all attachments for all roles
add_filter(‘ure_attachments_show_full_list’, ‘show_full_list_of_attachments’, 10, 1);
function show_full_list_of_attachments($show_all) {
$current_user = wp_get_current_user();
if (!in_array(‘hetbakenbeheren’, $current_user->roles) && !in_array(‘jaarboekje’, $current_user->roles) && !in_array(‘dominee’, $current_user->roles) &&
!in_array(‘kerkdienstplanning’, $current_user->roles)) {
return $show_all;
}

return true;
}

// ure_restrict_edit_post_type
add_filter(‘ure_restrict_edit_post_type’, ‘exclude_posts_from_edit_restrictions’);
function exclude_posts_from_edit_restrictions($post_type) {
$restrict_it = true;
$current_user = wp_get_current_user();
if (in_array($post_type, array(‘event’, ‘ctc_event’))) {
if (in_array(‘hetbakenbeheren’, $current_user->roles) && in_array(‘kerkdienstplanning’, $current_user->roles)) {
$restrict_it = false;
}
} elseif ($post_type==’ctc_sermon’) {
if (in_array(‘dominee’, $current_user->roles)) {
$restrict_it = false;
}
} elseif ($post_type==’tablepress’) {
if (in_array(‘jaarboekje’, $current_user->roles)) {
$restrict_it = false;
}
}

return $restrict_it;
}