I group users by custom user roles so each user groups can view and edit each others CPT . the problem i face now is when i give the user role capabilities related to edit and delete others posts, the be able to edit ALL other users posts and this is not what i want , i want them to only edit and delete posts made by other users in the SAME USER ROLE .
- i can get the custom user role i made for the current user.
- Now i have the user role , How to get all posts made by users with this user role.
- How to add these capabilities to the current user
delete_others_postsfor these posts only