Quick Hack to Enable the Dashboard Theme and Plugin Editor for WPMU

If you enjoy the convenience and ease of theme editing through the dashboard of WordPress single user, here’s a way to bring that back into your workflow when you are editing MU template files. It can really slow you down if you need to transfer files via FTP in order to make a few simple edits. In this tutorial we are going to hack WPMU to allow us to have editing privileges through the dashboard with three simple steps.

Step. 1. Navigate to wp-admin/includes and locate the mu.php file.

Step 2. Search for “unset( $submenu[‘themes.php’][10]” and comment out the lines that disable the editor

Look for this:

{code type=php}unset( $submenu[‘plugins.php’][15] ); // always remove the plugin editor
unset( $submenu[‘themes.php’][10] ); // always remove the themes editor{/code}

Change it to this:

{code type=php}/* unset( $submenu[‘plugins.php’][15] ); */ // always remove the plugin
/* unset( $submenu[‘themes.php’][10] ); */ // always remove the themes{/code}

Step 3: You’ve enabled the editor but now you must give yourself (the administrator) permission to access these pages.

Search for: “if ( strpos( $_SERVER[‘PHP_SELF’], ‘user-new.php” in mu.php.

Look for this:

{code type=php}$pages = array( ‘theme-editor.php’, ‘plugin-editor.php’ );
foreach( $pages as $page ) {
if ( strpos( $_SERVER[‘PHP_SELF’], $page ) ) {
wp_die( __(‘Page disabled by the administrator’) );{/code}

Change it to this:

{code type=php}$pages = array( ‘theme-editor.php’, ‘plugin-editor.php’ );
foreach( $pages as $page ) {
if ( strpos( $_SERVER[‘PHP_SELF’], $page )&& !is_site_admin() ) {
wp_die( __(‘Page disabled by the administrator’) );{/code}

Congratulations – you’re finished! Log into your dashboard and you should be able to edit your theme files and your plugin files. I hope that this little hack will save you some time in editing. I tested this out on WordPress MU 2.8.6 and it worked perfectly. Many thanks to Sanjeev Mishra for his tutorial on this subject. Happy editing!