Skip to content

Instantly share code, notes, and snippets.

@diije
Created June 12, 2013 12:56
Show Gist options
  • Save diije/5765009 to your computer and use it in GitHub Desktop.
Save diije/5765009 to your computer and use it in GitHub Desktop.
WordPress : autoriser l'upload de medias pour les contributeurs. Détails et explications : http://www.diije.fr/wordpress-autoriser-upload-contributeurs/
<?php
if ( current_user_can('contributor') && !current_user_can('upload_files') )
add_action('admin_init', 'dfr_upload_contributeurs');
function dfr_upload_contributeurs() {
$contributor = get_role('contributor');
$contributor->add_cap('upload_files');
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment