Want to know what WordPress Theme a site is using? Check Out Now!

How to Allow Contributors to Upload Images?

Do you want to allow your website contributors to upload images?

By default, WordPress doesn’t allow contributors to upload images to the WordPress website. There are two ways you want to allow contributors to upload photos.

WAY #1

The first way is to promote their user role from contributor to Author or Editor, giving them permission to upload and modify images on your WordPress website. However, doing them will also grant them additional rights, including publishing their posts on your site without you reviewing them.

WAY #2 – (Recommended)

The second way is to permit them to upload the images without promoting their role. And you can achieve this by adding the below code snippet to your WordPress website.

// If current user is contributor and doesn't have permission upload files
if (current_user_can('contributor') && !current_user_can('upload_files')){
    add_action('admin_init', 'maverick_allow_contributor_uploads');
}

/**
 * Allow Contributors to Upload Images
 */
function maverick_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 *