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.
Usamos cookies para personalizar o site para você e para analisar o uso do nosso site. Você demonstra que concorda com isso ao clicar em "Eu concordo" ou ao continuar usando este site. Mais informações sobre cookies podem ser encontradas em nossa Política de privacidade.