Skip to content

Instantly share code, notes, and snippets.

@bmsterling
Created October 7, 2012 03:57
Show Gist options
  • Save bmsterling/3847048 to your computer and use it in GitHub Desktop.
Save bmsterling/3847048 to your computer and use it in GitHub Desktop.
Disable changing the wordpress theme
/**
* 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