Change WordPress user roles and capabilities › Forums › Restrict or Permit access inside WordPress – how to › Post Edit Access: Granting other users access to uploaded media files › Reply To: Post Edit Access: Granting other users access to uploaded media files
Thanks Vladimir. I’ve tried that code and it lists all attachments, which is fine as a first step.
The only issue is that, for my use-case I don’t want the user seeing all attachments. I would only like the user to see attachments belonging to their team.
I was wondering if I could categorize media files and using the “”Posts Edit Access” feature to allow users to see shared media files “team-name-categorized” files as follows:
1. Enable categories for media library files using the code: register_taxonomy_for_object_type(‘category’, ‘attachment’)
2. Create a new category called “departmentAfiles”, and assign the category to a media file. The category would only be used to categorize shared files only for department A’s members.
3. Copy the category ID of “departmentAfiles” into the “Posts Edit Access” field “with category/taxonomy ID” – for department A’s role within User Role Editor
Basically, is there a way of applying the “Posts Edit Access” feature “”with category/taxonomy ID”” restriction to media files just like it works for pages?
Thanks.