How To Really Enable The WPMU Theme Editor
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
Comments
6 Responses to “How To Really Enable The WPMU Theme Editor”
Leave a Reply






Perfect!
I’m using WPMU to manage a bunch of blogs of which I am the author, a use the authors didn’t foresee.
I had found the second half, the bit to turn off the die in theme-editor.php, but was finding it annoying to have have to remember to bookmark to that page. With your post, I have my menu back.
Thanks.
I think we all (ahem) stretch the intended use of WPMU. I’m glad you found the post useful.
I’m thinking some sort of code change occurred around version 2.7, because I don’t remember having this problem on older versions of MU that I have used. I don’t have a lot of MU sites to admin, but I recall theme editor working.
It seems a better approach would be a tick spot to turn the editor on in the back end, and then give grave warnings upon doing so.
Thanks for the post.
I just do the second part, because I don’t want it showing up on the menu. Yes, sometimes I DO do this.
It depends.
The edit will get overwritten on upgrade though.
Thanks, Andrea.
Actually I hadn’t thought of direct linking to the editor once it was allowed. This probably is the best thing.
If MU gets installed even as a ‘private community’, and ‘Allow New Registrations’ is accidentally enabled, then ownage could be immanent.
I have been known to accidentally set my own stuff up incorrectly at times 8-p.
Hmm, I’m running MU 2.8.4 and it seems that wp_die line in theme-editor.php has been pre-removed.
This is what mine looks like:
require_once(’admin.php’);
$title = __(”Edit Themes”);
$parent_file = ‘themes.php’;
Any ideas?