I need to give access to "Editor" role, to be able to read and edit all users' media attachments. I found that a plugin can do this: https://wpfront.com/user-role-editor-pro/media-attachment-file-permissions/ .

Any ideas how to achieve this without using a plugin?

1 Answer 1


As far as I know there's no standard capabilities just for attachments. You'd need edit_posts.

function add_theme_caps() {
    $role = get_role( 'editor' );
    $role->add_cap( 'edit_others_posts' ); 
add_action( 'admin_init', 'add_theme_caps');
  • By defaults, editor role already has capability to "edit_others_posts". I need the editors to be able to add feature image from images/media library (that already uploaded by admin and/or other users) when they edit other user's post.
    – Malvyn
    Commented Dec 14, 2016 at 4:59
  • Aren't they allowed that by default too? I think edit_others_posts takes care of that. You could try the upload files capability too, but I think that's a default for editors as well.
    – Pim
    Commented Dec 14, 2016 at 5:44
  • Yes, the upload files capability is enabled by defaults for editors role. And yet the media/images files shown in the library are only the ones that uploaded by themself.
    – Malvyn
    Commented Dec 14, 2016 at 23:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.