WordPress Snippets at WPcustoms

Allow contributors to upload images

You can easily adjust the user capablities and user roles. check out the codex for more.


/**
 * Snippet Name: Allow contributors to upload images
 * Snippet URL: http://www.wpcustoms.net/snippets/allow-contributors-to-upload-images/
 */
 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');
     }