enable upload/insert option for contributor in wordpress

If we know about wordpress user role and their accessibility it is known that no contributor can’t upload/insert any image or can’t set feature image for their post …

there is a little code to enable this feature for each contributor anyway .. we have to edit function.php file in theme directory ..

just add the below code to enable this feature for contributor

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');
}
Advertisements

One comment on “enable upload/insert option for contributor in wordpress

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s