Yes the better solution is to use add_role( $role, $display_name, $capabilities );
and make a distinct role for the front end.
That way you have a separation of abilities that is easier to manage, the way you are doing it will lead to trouble.
Related Posts:
- wp_editor with media buttons
- Frontend media shows “An error occurred in the upload. Please try again later.”
- Set a maximum upload count for users on a specific user role
- Disable TinyMCE Drag and Drop
- How to change upload directory based on frontend form input name or ID?
- Enabling users to upload files
- Upload featured image from front end using media-upload.php
- How can I manage and limit disk usage for each author?
- Front-End Upload media with category
- Set default “Link CSS Class” in add media admin editor
- Extend Media Library
- How to make “Upload files”selected by default in Insert Media?
- How to show all available images in WP’s media library when using the Polylang plugin?
- Upload post thumbnail from the front end
- Saving Media – Which Hook is Fired?
- Set limit to media upload?
- WordPress 3.5: Switch back to Old Media Uploader?
- Use a separate custom table (not posts) to handle file upload data
- Insert images to post not working
- wp_generate_attachment_metadata returns empty array
- Settings in ‘Media > Settings’ is ignored when inserting images
- Password protect some uploaded files, so only logged-in users can view them
- How to protect uploads in multisite if user is not logged in?
- using media uploader to select image of specific size, enforce cropper
- Append button to WordPress Image Details modal
- Modify the array of selected images in media modal
- Media uploader not work properly [closed]
- Retrieving JSON data in ajax request from media uploader
- How to disable WordPress Media resize different size version?
- insert post & Upload post thumbnail from the front end using ajax
- Saving WordPress generated thumbnails in a subdirectory
- How to side load an image from a service
- Add select field to media uploader that adds a class to the image
- How to host different file formats/types for a media attachment without creating multiple attachments?
- Retroactively place uploaded media into -month, -year based folders?
- How To install AWS SDK for PHP in wordpress?
- wp.media add context
- Add fields to the WordPress media uploader
- Change default from “Attachment post URL” to “File URL” in Add Media
- wp_editor in front end not working
- How do I modify the url of uploaded media content?
- Uploading images on front end doesn’t generate thumbnail sizes
- Why would media_sideload_image() not work locally?
- WordPress bug with capabilities?
- Restrict WordPress Media Library for a specific user role (users can only see/select own media)
- Media upload on WordPress changes title of image
- move_uploaded_file() not working on wordpress front end
- ‘An error occurred in the upload. Please try again later.’ for users with different roles
- Convert (-) and (escape) signs to (_) when uploading files on wordpress media library automatically
- wrong media url in wordpress
- Move files from flat upload directory to organised by year / month
- Can’t manipulate media uploads
- Prevent small image sizes from being uploaded
- Front-End Social photo upload [closed]
- Protecting uploads not working
- How to get the return value of wp.media({ frame: ‘post’ }) in all cases?
- Custom media uploader not showing library
- What is the way to add additional fields to attachments in 3.5+?
- Create featured image from a remote url when creating a post
- tb_show not showing a media upload window . custom plugin
- In the media Rest API, what is “missing_image_sizes”?
- Error: The uploaded file exceeds the upload_max_filesize directive in php.ini [duplicate]
- How can I modify the media upload form fields?
- Migrating media files (documents only) to a fresh install and maintaining the same directory structure
- How does wordpress handle media files?
- WordPress media upload issue could not insert attachment into the database
- Thumbnail images missing in WP media library
- upload_max_size doesn’t change
- Upload and attach to a post multiple image files [closed]
- Reattach media after moving to another server
- Upload PDF and other files from the Front-End
- What if I have a large file on the server that I want the wp library to have?
- Bug: Deleting file, then uploading same file again places file in an old month folder
- Efficient way to move media folder to another folder
- Do custom post type (CPT) attachments/media store the parent post ID?
- Create multiple folders in upload media folder
- How to change Route respond To A specific Path?
- WordPress media has all disappeared on wp-admin but still on the server
- media file uploading
- Media Library: Remove replace images of selected author
- Editor User Role can’t see other users media
- How to upload multiple images using WP rest API to media?
- Media files not loading
- Moving wp-content folder to public_html
- Using Gravity Forms to upload media into library, then attach to post
- How use custom upload directories in filesystem and url based on media type or category
- Organizing the Media Library for Cleanup
- Allow author to upload image via Media button without plugin
- get users nickname uploaded media
- Force relative path in media library for LAN deployment
- Make custom thumbnail size image in media_sideload_image function
- Custom post type media upload error with custom user role
- Set featured link not showing
- wordpress 3.6 media manager cropping timestamp
- Add frontend editor with media buttons for Visitors and display only their media
- Can’t upload files 1MB+ [closed]
- How to upload and add images to the existing post from the front-end with admin approval which is posted by other user
- Updating Media Library PDF’s in bulk
- How to properly move media files and update data?
- Is it possible to restrict the number of media uploads (photos) per user?