Created
October 13, 2016 08:10
-
-
Save svenl77/6c2ac55780d77201a7c9a7c353d20ff7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Check if a contributor have the needed rights to upload images and add this capabilities if needed. | |
*/ | |
add_action('init', 'buddyforms_allow_contributor_uploads'); | |
function buddyforms_allow_contributor_uploads() { | |
if ( current_user_can('contributor') && !current_user_can('upload_files') ){ | |
$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