Upload Files Capability from the Frontend for different User Roles


I can't add media when I log in as a contributor. Is there a way to bypass that, or will I have to give users Author roles to be able to add media?

By default BuddyForms takes care of the normal subscribers. This is the most common user role for normal user who creates an account on your site.

Normally you do not want normal subscribers to go into your backend. All higher user roles mostly are able to post from within your WordPress backend.

If you want to allow another user role as subscribers to be able to upload files to the WordPress media library, you need to allow it in your functions.php or via a plugin.

Via Plugin

I can recommend you this Plugin: http://wordpress.org/plugins/members/ from Justin Tadlock which gives you the possibility to add and remove capabilities.

Via PHP 

In this example, we will give contributors upload rights.

Just add this function into your functions.php and change "contributor" to the user role you want to give upload rights. This will work.

Remove subscriber upload rights 

If for some reason you want to remove the rights given to subscribers from BuddyForms, just add this hook somewhere in your functions.php

remove_action( 'init', 'buddyforms_allow_subscriber_uploads' );

Still need help? Contact Us Contact Us