admin管理员组

文章数量:1313243

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: / .

Any ideas how to achieve this without using a plugin?

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/user-role-editor-pro/media-attachment-file-permissions/ .

Any ideas how to achieve this without using a plugin?

Share Improve this question asked Dec 14, 2016 at 0:39 Malvyn Malvyn 11 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 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');

本文标签: capabilitiesAdd capability to quotEditorquot role to be able to view all users attachments