Enabling the Theme Editor
In wordpress MU the theme editor is switched off since there’s a security flaw in its design whereby any user is able to change the current theme/template with it. This is a bit of a pain when building a new site as during testing I often want to change a tiny thing or to try something out. Having to log in via FTP, download the file, change it and re-loading it back again is rather inconvenient, making a simple 1 minute job into 5 minutes. So I looked around for a solution to get the theme-editor.php back onto the admin menu.
I discovered that what I had to do was to create a new PHP file inside the mu-plugin folder called "theme-opts.php" (for example) and fill it with the code below:
<?
add_action( ‘admin_init’, create_function(‘$pages’, ‘if(is_site_admin()) return remove_action("admin_init","disable_some_pages");’),1);
add_action( ‘_admin_menu’, create_function(‘$theme_menu’, ‘return add_theme_page( "Editor", "Editor", "edit_themes", "theme-editor.php");’ ));
add_action( ‘_admin_menu’, create_function(‘$plugin_menu’, ‘return add_submenu_page( "plugins.php", "Editor", "Editor", "edit_plugins", "plugin-editor.php");’ ));
?>
This code re-adds some of the options that are available in the single user wordpress software but is missing from the multi-user platform. It’s not really a good idea to leave these options online when the site is open to the public, but for testing/development purposes it is completely fine.