How To Really Enable The WPMU Theme Editor

May 10, 2009 · Filed Under Basics · 6 Comments 

Call me a n00b, but I like to use the theme editor in WordPress to get the themes to suits me.  I can move around all the different files needed to make changes to the sidebars and tweak the CSS files fairly quickly and when you use the Find box in the status bar of Firefox, locating a particular spot in the code is very fast.

When you do your first WordPress MU install  one of the first nuisances you run into is the lack of a theme editor “out of the box”.  A quick trip around Google will inform you that it is a huge security hole to enable an editor in WPMU.

Being a fairly unpopular fellow, my WPMU installs have an amazing lack of real users, so I really don’t have many security fears.  So, dang it, give me my editor back.

Several blogs offer the answer.  Simply open admin/includes/mu.php and get yourself down to line 530 (in PSPad anyway) to find:

unset( $submenu['themes.php'][10] ); // always remove the themes editor

This line prevents the editor from being loaded. Either comment or delete this line.  Save and re-upload.

You’re supposed to now be in business.  However, on my sites, I find that, yes I do now have a link in the backend for the Editor, but when I click it, the next page says ‘Disabled’.

I quizzed my code guru buddies in IRC and found no one n00b enough like me to use the theme editor.

Anyway, to get to the point, I noticed the file returning the  ‘Disabled’ message was theme-editor.php.  The WordPress powers that be are pretty much opposed to theme editing and yet they ship with this file.  I poked around it a bit and noticed this:

require_once(’admin.php’);
wp_die( ‘Disabled’ );
$title = __(”Edit Themes”);
$parent_file = ‘themes.php’;

Either comment or delete the “wp_die( ‘Disabled’ );”  at line 11 or so.  This will allow the editor to load up and you’re then on your way.

Good luck with it.

Related Articles

Share/Save/Bookmark