If you are developing a website based on the WordPress content management system for another company or individual, you may need to prevent them from switching themes.
To make sure your client won’t be able to switch theme, you need to paste the following code in the functions.php file in your WordPress theme folder:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
add_action('admin_init', 'dukeo_lock_theme');
function dukeo_lock_theme() {
global $submenu, $userdata;
get_currentuserinfo();
if ($userdata->ID != 1) {
unset($submenu['themes.php'][5]);
unset($submenu['themes.php'][15]);
}
}That’s all you need to do! Easy enough?


This is really what I want.
Thanks Stéphane :)
You’re welcome !