Allow contributors to upload files

If you have contributors to your blog, you probably got annoyed to see that they can’t upload files and images while writing guest posts for you. Today’s recipe will solve the problem, allowing contributors to upload files to your blog.

Nothing hard with this code: The only thing you have to do is to paste it in your functions.php file:

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

Leave a Reply

Your email address will not be published. Required fields are marked *