Created
June 2, 2019 23:14
-
-
Save ericnicolaas/e7118bb0bf918c672d024a6e113f340d to your computer and use it in GitHub Desktop.
Add Campaign Manager capabilities to Editor role
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
add_action( | |
'init', | |
function() { | |
$campaign_manager = get_role( 'campaign_manager' ); | |
$editor = get_role( 'editor' ); | |
foreach ( $campaign_manager->capabilities as $cap => $has_cap ) { | |
if ( ! $has_cap ) { | |
continue; | |
} | |
if ( ! $editor->has_cap( $cap ) ) { | |
$editor->add_cap( $cap ); | |
} | |
} | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment