Linkon
Linkon

Reputation: 11

How to allow the "contributor" to upload only featued image in wordpress

I am facing a problem with my wordpress site.In my site I prevent/disallow the "contributor" to upload media files. But I want them to upload only the featured image. So what is the trick in that case?? Is there any code?? or any plugins?? I searched a lot but found nothing related to it. I badly need that. Please help me. Thanks in advance.

Upvotes: 1

Views: 1033

Answers (1)

mazher ul haq
mazher ul haq

Reputation: 45

Add this code in your cuurent theme's 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');
}

Upvotes: 3

Related Questions