A PublishPress user wrote to us with question:
I have just installed your PublishPress Capabilities plugin, which is working almost perfectly. The problem that I'm having is that my user can upload images but can not edit the Alternative Text, Title, Description and Caption of the image, which I need the user to be able to do. How can I fix this problem?
This is not the first time we have had this question, so I'll explain the problem and solution.
The problem with editing media files
This situation often arises when you do these two things for a user role:
- Remove access to Posts and Pages.
- Give access to another plugin.
This image below is taken from the main PublishPress Capabilities screen. I have removed access to both Posts and Pages, but given this user access to WooCommerce Products, Orders and Coupons.
In this situation, this user will not be able to edit any of these fields for a media file:
- Alternative Text
Why does this problem happen?
Normally, to edit the details for this media files, you need the edit_posts permission.
Even if you do have the edit_posts permission, you will only be able edit files that you have uploaded. You will also need the edit_others_posts permission to change the details for other users' files.
Those two permissions are shown in this next image:
Note: if you want to control who can upload media, use the upload_files permission.
The solution to editing media files
In most situations, the best solution is not to give users the edit_posts permission. This is because you have already decided that users should not be editing posts.
Here is a better solution:
- Go “Capabilities” in your WordPress admin menu.
- In the top-left corner, choose the user role you want to change.
- Check the “Media” box under “Type-Specific Capabilities“.
- Click “Update”.
- Now you can see three new boxes in the “Media” row. You can use these boxes to allow your user to edit media files. For more on deleting media files, read this post.