Created
July 29, 2019 12:05
-
-
Save MichaelConte/9ab654db040485cb0e85f6c6195fe5cb to your computer and use it in GitHub Desktop.
Permit User to Upload Images
This file contains 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
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'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment