Created
October 7, 2012 03:57
-
-
Save bmsterling/3847048 to your computer and use it in GitHub Desktop.
Disable changing the wordpress theme
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
/** | |
* Disable changing the theme for anyone a part from the admin user | |
*/ | |
add_action('admin_init', 'disable_changing_theme_for_non_admin'); | |
function disable_changing_theme_for_non_admin() { | |
global $submenu, $userdata; | |
get_currentuserinfo(); | |
if ($userdata->ID != 1) { | |
unset($submenu['themes.php'][5]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment