WordPress, by default, does not allow contributors files to the site. WordPress contributors do not have the media tab on the dashboard to add any media files to the library. This article shows you how to add a media tab and allow contributors on your WordPress site to upload files using a simple PHP code snippet.
Follow the steps below to edit your Theme setting file to enable media tab for WordPress contributors:
The files for this selected theme are listed on the right column under Theme Files. Click on the file named “functions.php”:
if ( current_user_can('contributor') && !current_user_can('upload_files') ) add_action('admin_init', 'allow_contributor_uploads'); function allow_contributor_uploads() { $contributor = get_role('contributor'); $contributor->add_cap('upload_files'); }
Before : Media option is not available for contributor
After inserting the script: Contributor has the Media option to upload files:
Subscribe to receive weekly cutting edge tips, strategies, and news you need to grow your web business.
No charge. Unsubscribe anytime.
Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.
We use cookies to personalize the website for you and to analyze the use of our website. You consent to this by clicking on "I consent" or by continuing your use of this website. Further information about cookies can be found in our Privacy Policy.