Unify the roles and caps?
Try the Members Plugin. This will allow you to create a new roles (which you can then assign to the groups) with their own cap or mixture thereof.
Try the Members Plugin. This will allow you to create a new roles (which you can then assign to the groups) with their own cap or mixture thereof.
The edit_others_posts capability should allow users to set the author of a post. At first glance you might reply that you don’t want your authors to be able to edit one another’s posts. The difference in ability is very subtle though: writing a post and then assigning it to another user isn’t much different from … Read more
Set it up so that your editors and writers use the default title as the first line and add a metabox for a subtitle that will output the other lines as separate lines. This will require a theme adjustment if you want them all included in the h1 header tag. With some adjustments to the … Read more
I want to throw this out there as an answer to the question. I have stumbled across a plugin that will take WordPress’s permissions to the next level. It is called Press Permit. http://presspermit.com/extensions/pp-collaborative-editing/ Taken from Press Permit FAQ’s: How does Press Permit compare to Capability Manager, User Role Editor and other role editor plugins? … Read more
After hours of fighting to get this to work, it was just a matter of changing delete_posts to delete_post. So, in it’s entirety this would be: current_user_can(‘delete_posts’, $post_id); to current_user_can(‘delete_post’, $post_id); current_user_can does accept a second parameter. Though it’s weird that the function declaration in capabilities.php does not define a second parameter as pointed out … Read more
Me, like @fischi think that filter ‘user_has_cap’ is the best choiche for the pourpose, however, I think that is better to the work, regardless the $_GET post or action: WordPress check the meta cabability on a per-post basis, using an additional argument. In few words, when filtering ‘user_has_cap’ for a meta capability (see https://codex.wordpress.org/Function_Reference/map_meta_cap) we … Read more
Looking at your code I think you are trying to modify the capabilities of existent roles. Am I right? To do that you have to run the add_cap for a role object, not for a user object. Also, you must know that add_cap only accept one capability as string: $role = get_role( ‘editor’ ); $role->add_cap( … Read more
Found the basic problem! Although a different context than the one you described, the root cause is probably the same. I was trying to allow users to setup a personal page and upload an image to display there. I kept getting the dreaded “You don’t have permission to attach files to this post”. The message … Read more
Solved with this Answer at Stack Overflow. Each Array Key was the actual name of the capability […] You were searching for the capabilities by name, and since you were only seeing 1s in the output, I figured what you were looking for was in the keys. foreach($capslist as $cap=>$caps){ $dropdown .= ‘<option value=”‘.$cap.'”>’.$cap.'</option>’; }
I think you are using it right. I think it is actually a bug in WordPress. When you do the same for roles $somerole->add_cap( ‘some_cap’, false );, it works as expected.