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

December 15, 2009  | 
10 Comments

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:

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

Change it to this:

/* unset( $submenu['plugins.php'][15] ); */ // always remove the plugin
/* unset( $submenu['themes.php'][10] ); */ // always remove the themes

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:

$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') );

Change it to this:

$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') );

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!

Featured Plugin - Start your own Quora / StackOverflow / Yahoo Q&A site

It's now incredibly easy to start your own Q&A site using nothing more than WordPress - The Q&A plugin simply and brilliantly transforms any site, or page, into a perfect support or Q&A environment.
Find out more

Featured Plugin - Turn any WordPress page into a fully featured wiki!

To get a wiki up and running you used to need to install Mediawiki and toil away for days configuring it... not any more! This plugin gives you *all* the functionality you want from a wiki, in WordPress!!!
Find out more

Featured Plugin - Start Your Own Powerful Membership Site

If you're thinking about starting a paid, or just private, membership site then this is truly the plugin you've been looking for. Easy to use, massively configurable and ready to go out of the box!
Find out more

Featured Plugin - Easily integrate your WordPress site with Facebook

Would you like to add Facebook comments, registration, 'Like' buttons and autoposting to your WP site? Well, The Ultimate Facebook plugin has got that all covered!
Find out more

Featured Plugin - Host sites, get paid, just like WordPress.com

If you've ever wondered how you could offer a paid site management and hosting service, then this is the plugin for you. Offer a freemium or paid service, for any niche you like, it's powered Edublogs.org to success already!
Find out more

Featured Plugin - Add bottom corner (or anywhere else) chat to your site

No javascript required, no third part chat engine, just fully featured chat right in your own database on your own WP sites - couldn't be easier.
Find out more

Featured Plugin - WordPress + Google Maps = Perfect

Simply insert google maps into posts, sidebars and pages - show directions, streetview, provide image overlays and do it all from a simple button and comprehensive widget.
Find out more

Featured Plugin - Open an Online Store with MarketPress

Out of all the WordPress ecommerce plugins available, this has got to be the winner - easy to configure, powerful functionality, multiple gateways and more. A simply brilliant plugin!
Find out more

Featured Plugin - Send beautiful html email newsletters, from WordPress!

Now there's no need to pay for a third party service to sign up, manage and send beautiful email newsletters to your subscriber base - this plugin has got the lot.
Find out more

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

  1. Nice!

    Might there be a way to limit the files accessed via the editor. For example, only ‘style.css’?

    Thx

  2. This is great, thanks! I’ve been looking for a way to edit themes/plugins in wpmu. Unfortunately, I just tried it without success. No editor in sight. I’m logged in as site administrator. Can you tell me how to troubleshoot?

  3. Thanks for the post. Figuring out which things work in WPMU and which things are WP-only can be mindboggling.

  4. &&
    should be actual ampersands not the code as it reads or you will get an error about an unexpected ;

  5. “&&
    should be actual ampersands not the code as it reads or you will get an error about an unexpected ;”

    Voila, there it is! Thank you both!

  6. Yes, sometimes you have to change quotes or ampersands when copy and pasting because of the way WordPress outputs it when I paste code into a blog. Glad you have it working now!

  7. Any thoughts on limiting editing to a single file?

  8. This saved my bacon. You rockkkk!

  9. Thank You very much, this is really helpful.

  10. awesome. thanks!

Click on a tab to select how you'd like to leave your comment

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting