Opened 4 months ago
Last modified 4 months ago
#23391 new enhancement
User in contributor role can add images to post only via the text editor
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Role/Capability | Version: | |
| Severity: | normal | Keywords: | |
| Cc: |
Description
- Create a user with contributor role
- start new post with it
- notice there is no "add media" button anywhere
- switch to text editing
- use the img button to insert a URL to a valid img on the web
- request approval for the post
- let admin/editor approve it
- go the the post's URL and notice that the image is shown
So, it is not that contributors are not allowed to use images, it is just that WP makes it hard to do so.
Either HTML needs to be sanitized and have all img tags removes for contributors, or access to the media library should be allowed for contributors denying only access to uploading. I vote for the second option.
Change History (2)
Replying to ocean90:
The "Add media" isn't displayed because the user hasn't the upload_files cap.
I get the code, I just think it is applied in the wrong place. You should not show the upload tab, and maybe not the media tab, but the "from url" and "gallery" tabs don't do anything that a contributor can't do via the text editor.

The "Add media" isn't displayed because the user hasn't the upload_files cap.
Related: #19834