Posted By

jamiebrwr on 05/14/11


Tagged

wordpress theme disable


Versions (?)

Easily disable theme changing


 / Published in: PHP
 

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

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.

  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. }

Report this snippet  

You need to login to post a comment.