Change WordPress user roles and capabilities › Forums › Bug Reports › editors unable to edit media metadata
Tagged: alt, caption, description, image, media
- This topic has 6 replies, 2 voices, and was last updated 9 years, 1 month ago by
moranme.
-
AuthorPosts
-
11/10/2016 at 15:38 #2868
moranme
ParticipantEditors can upload images under “Add New Media” but it won’t let them add/edit the fields: caption, alt, description. I created a new editor role and enabled all capabilities, but it didn’t fix the problem. As Admin, I am able to add/edit this data. Have you seen this before? I need the editors to be able to add captions to their photos.
PS I’m also using ACF and Adminimize plugins.
12/10/2016 at 02:43 #2869Vladimir
KeymasterWill editor can edit those fields if you deactivate User Role Editor?
21/10/2016 at 14:33 #2891moranme
ParticipantHi Vladimir,
Yes, I narrowed down the problem further. It seems to be specific to the page restriction. All of my editors are restricted to be able to edit just one page. With this setting, they can edit their one page and upload new media (but unable to edit the metadata, which is my problem). When I turn this setting off (allowing them to edit any page), then the problem goes away and they can edit metadata.
To restrict their editing to just one page, I go to each user profile, and in the Posts/Pages/Custom Post Types Editor Restrictions section, I click the radio button for “Allow” and then enter the page ID number in the field called “with post ID (comma separated).”
22/10/2016 at 01:02 #2892Vladimir
KeymasterHi,
When you set edit restrictions for the role or user User Role Editor applies this restriction to all post types including the ‘attachment’ one. WordPress use this post type for the Media Library items.
It’s possible to exclude some post types from this restriction scope with custom filter:
Try to exclude ‘attachment’ post type from edit restrictions using this filter.24/10/2016 at 14:12 #2900moranme
ParticipantThanks. Does that code go in functions.php?
And would it be this, exactly?
add_filter('ure_restrict_edit_post_type', 'exclude_posts_from_edit_restrictions'); function exclude_posts_from_edit_restrictions($post_type) { $restrict_it = true; if (current_user_can('editor')) { if ($post_type=='attachment') { $restrict_it = false; } } return $restrict_it; }24/10/2016 at 15:06 #2901Vladimir
Keymaster‘Yes’ on both questions.
24/10/2016 at 15:41 #2902moranme
ParticipantNever mind I got it to work! I put that code in functions.php and that fixed it. Thank you so much for the fast response!!
-
AuthorPosts
- You must be logged in to reply to this topic.