Disable Theme Changing For WordPress

It often becomes necessary to remove functionality to prevent clients from accidentally messing up their website.  In this case we are going to remove the ability for them to change their WordPress theme with this snippet.  Just copy/paste this into functions.php.

The PHP

add_action( 'admin_init''slt_lock_theme' );
functionslt_lock_theme() {
    global$submenu$userdata;
    get_currentuserinfo();
    if$userdata->ID != 1 ) {
        unset( $submenu['themes.php'][5] );
        unset( $submenu['themes.php'][15] );
    }
}

Source: Steve Taylor

Share this on...Share on Facebook0Tweet about this on Twitter2Share on Google+1Digg thisShare on LinkedIn0Share on Reddit0Share on StumbleUpon0Pin on Pinterest0

Leave a Reply