Skip to content

Instantly share code, notes, and snippets.

@davemac
Created May 22, 2018 03:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davemac/c150fe755a9879b4077d36ec40e8ed43 to your computer and use it in GitHub Desktop.
Save davemac/c150fe755a9879b4077d36ec40e8ed43 to your computer and use it in GitHub Desktop.
modify editor user role
// allow editors to manage gravity forms
// allow editors to use Appearance menu
// allow editors to manage co-authors plus plugin, create guest authors
// allow editors to manage Privacy sub-menu under Settings
function dmc_modify_editor_role() {
$role = get_role( 'editor' );
$capabilities = array(
'gform_full_access',
'edit_theme_options',
'coauthors_guest_author_manage_cap',
'manage_privacy_options',
);
foreach ( $capabilities as $cap ) {
$role->add_cap( $cap );
}
}
add_action( 'admin_init', 'dmc_modify_editor_role' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment