Easily disable theme changing


/ Published in: PHP
Save to your folder(s)

When creating a WordPress based website for a client, you may need to make sure that he can’t switch themes. This is what I’m going to show you in today’s recipe.


Copy this code and paste it in your HTML
  1. add_action('admin_init', 'slt_lock_theme');
  2. function slt_lock_theme() {
  3. global $submenu, $userdata;
  4. get_currentuserinfo();
  5. if ($userdata->ID != 1) {
  6. unset($submenu['themes.php'][5]);
  7. unset($submenu['themes.php'][15]);
  8. }
  9. }

URL: http://www.wprecipes.com/how-to-easily-disable-theme-changing

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.