admin管理员组文章数量:1313056
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 badge1 Answer
Reset to default 1As 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
版权声明:本文标题:capabilities - Add capability to "Editor" role to be able to view all users attachments 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741938127a2405978.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论