This is a bit out of context but I think you can approach it a little bit differently, you can limit access to default media library for roles below “admin” or “editor” depending on your setup. For instance you can block authors from uploading files to media library using the following code..
if ( current_user_can('author') && current_user_can('upload_files') )
add_action('admin_init', 'remove_author_uploads');
function remove_author_uploads() {
$author = get_role('author');
$author->remove_cap('upload_files');
}
Then allow them to upload to media library from a front-end page on the site. Here is a good reference to that How can I add an image upload field directly to a custom write panel?
Related Posts:
- How to re-arrange media uploaded using : media_handle_upload() as per year / month
- WordPress media uploader – upload tabs not hiding
- Can’t upload format files on media library
- Custom Link In WordPress Media “Attachment Details” Upload Screen
- How can I add a Description column to the media library browser screen?
- Upload files in wordpress
- Rename UPLOADS folder with custom WP_CONTENT_DIR
- Decrease file size upload in Media
- Remote upload file to server B
- Using Images in WordPress – Best Practices
- How to move wp-content (or uploads) outside of the WordPress directory
- Limit Media Library to Given Folder
- Set a maximum upload count for users on a specific user role
- How to make custom bulk actions work on the media/upload page?
- Is there a plugin to make attaching images easier?
- Automatically wrap post image in div
- media_handle_upload weird thing
- Looking to display non-image files in Gallery with logo specific to file type
- where can i add custom script to stop header video from autoplay
- Retrieving and Storing Images Linked from Other Domains on Local Server?
- How do I go straight to “Edit More Details” when clicking on an item in the media library?
- What’s the best “insert all images” plugin?
- Syncing Avatars across multisite
- How to stop unlink images when remove a site or user
- Hide upload image fields for the different media upload popups
- How to retrieve alt attribute for an attachment (uploaded image)?
- Customizing default Mediaelement player
- How to insert a sitemap within a subsite when using WordPress multisite
- Add a InfoBox in the media upload window
- I’m using add_meta_box() but want to include TinyMCE editor *and* Media Uploads for each box
- Get Image from Media Library with the Title
- wp_generate_attachment_metadata is creating an empty array
- custom upload directory only for plugin uploads
- problem in uploading attachment to custom directory
- Installing new theme on running site
- Media Upload not working after hiding some elements from functions.php
- Personalized Gallery what are my options?
- the temporary save folder is wrong
- wp_delete_attachment doesn’t delete image files / doesn’t work
- Altered Media Library URLs
- How do I enable the text editer in my WordPress theme? [closed]
- Limit attachment caption characters
- Organizing the Media Library for Cleanup
- Customizing the built-in Media Playlist
- Custom image sizes ignored in WP 3.5
- WordPress uploads directory. Featured Images storage
- Can’t upload files 1MB+ [closed]
- Custom Search on media files PDF images pages posts
- How can I get the Media Library backend to show larger thumbnails?
- How to disable the PDF preview in the file block by default
- MIME type not supporting HEIC support type in WordPress
- Get All Results From Other Users That Share The Same Custom User Meta As Current User
- Can we set a redirection with dynamic content in url?
- How to make conditional statement in WpBakery (formarly Visual Composer)
- How do I make mysite.com/comingsoon WordPress to become my main website’s WordPress?
- Simple custom attributes on posts
- Multiple header style under meta box
- Use a custom page with dynamic content as a user profile page
- website is not loading home page (moving from one server to another server)
- Best practice to generate token for email action
- Style WooCommerce Product Search Widget
- Display all subterms of a custom taxonomy filtered by parent terms
- how to change the url rediction of the woocommerce login page of the flatsome theme for my own in wordpress?
- My list of terms of custom taxonomy displays 7 times
- why won’t my custom css load with the enqueue method or any other method?
- Upload error on localhost (at minimum, not yet tested online)
- How to add HTML into error message
- how to split and upload a theme on wordpress?
- Delete a column in edit.php generated with a plugin
- Customizer options limited to specific user roles?
- Product page not found if product data is set Appointment Service
- How to change Route respond To A specific Path?
- Block direct access to thank you pages
- How do I add a dropdown menu to a form?
- What is my error trying to create a new table in the database?
- I want to embed mystream video in my wordpress site
- SVG not displaying in Media Tab in Backend
- Current menu item highlights wrong
- Adding a custom field to a slug
- Measure time in ONLY HOUR format
- Add admin page for specific post status (for example)
- WordPress media has all disappeared on wp-admin but still on the server
- Query Product categories what have a custom field
- Get /users/me details from WordPress backend
- mailchimp integration on a custom footer
- How to increase media image scale limit?
- Can’t Customize WordPress Page
- ACF unable to use user field
- Bootstrap slider not working
- media file uploading
- Use Theme CSS in custom code
- Modify Maximum upload file size text in WordPress Media
- How to get the full product name by ignoring custom modification on it
- adding fade on mouseover to images
- where is admin footer?
- Customize section does not show my widget areas
- How can i add customisation of text to my theme?
- Add producthunt badge to wordpress menu
- Missing a temporary folder not fixed
- Can I overwrite custom taxonomy FROM “public” TO “false”