Disable Theme & Plugin Editor in WordPress

Recently I was trying to disable the theme and plugin editor in WordPress so that other users couldn’t edit the plugins or themes. After searching around there was no easy solution that didn’t involve hacking core WordPress files. I did find a post with some code on how to disable both the theme and plugin editor but it wasn’t entirely complete and was for WordPress MU. So I decided to take it one step further and create a plugin for it that would work for the standard WordPress.

I have also included notes in the plugin if you want to just disable the theme editor or the plugin editor or to even set the user level to disable the editors.