Created
August 9, 2018 10:55
-
-
Save fillipetech/e78ee6c786b4648dabd269c80b57040f to your computer and use it in GitHub Desktop.
Allow Contributors to Add Media #user #role #cap
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
| //Allow Contributors to Add Media | |
| function allow_contributor_uploads() { | |
| $contributor = get_role('contributor'); | |
| $contributor->add_cap('upload_files'); | |
| } | |
| if ( current_user_can('contributor') && !current_user_can('upload_files') ) { | |
| add_action('admin_init', 'allow_contributor_uploads'); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment