Remove theme editor from WordPress setting menu

Many wordpress developers want to remove the theme editor option from wordpress appearance settings menu. Due to security reason removing theme editor from wordpress admin section is really great idea.

In this tutorial I given simple steps to remove theme editor option from your wordpress admin section.

You just need to copy and paste following code into your functions.php file. That will hide the theme editor menu from settings page.
Using following code you can easily remove editor.

function wpapi_remove_editor_menu() {
  remove_action('admin_menu', '_add_themes_utility_last', 101);
}

global $remove_submenu_page, $current_user;
get_currentuserinfo();
if($current_user->user_login == 'admin') { //Specify admin name here
    add_action('admin_menu', 'wpapi_remove_editor_menu', 1);
} 
Remove theme editor from WordPress setting menu
Remove theme editor from WordPress setting menu