Change WordPress user roles and capabilities › Forums › Restrict or Permit access inside WordPress – how to › Grant separate permissions additionally to a role › Reply To: Grant separate permissions additionally to a role
If you setup the code for custom filter ure_restrict_edit_post_type (I gave the link above) to exclude events from the edit restrictions, user will have access to all events without restrictions. It does not depend from post ID list in the edit restrictions form.
You just need:
1) replace ‘editor’ with your own role ID, let it be ‘role_a’;
2) replace ‘post’ with valid custom post type for events, let it be for this example: ‘event’.
So instead of
if ( in_array( 'editor', $user->roles ) ) {
if ( $post_type==='post' ) {
$restrict_it = false;
}
}
your code will have
if ( in_array( 'role_a', $user->roles ) ) {
if ( $post_type==='event' ) {
$restrict_it = false;
}
}
In assumption that you made all correctly, you can input post ID list after that and check that all events are still available for the role.