Created
September 28, 2016 07:23
-
-
Save jimmy89Li/9463bb8ca76587f824cd70e1b715511e to your computer and use it in GitHub Desktop.
Allow the editor to edit theme options
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 the editor to edit theme options | |
function add_theme_caps() { | |
// gets the editor role | |
$role = get_role( 'editor' ); | |
// This only works, because it accesses the class instance. | |
// would allow the editor to edit options posts for current theme only | |
$role->add_cap( 'manage_options' ); | |
} | |
add_action( 'admin_init', 'add_theme_caps'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment