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.


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

Source: Steve Taylor