Many “authorities” will tell you there is no WordPress MU file editor, and give you complicated workrounds to let you edit plugins and themes directly.

This is no longer true.

The latest version of multiuser WordPress has the standard file editor – it just needs to be enabled.

First, a couple of warnings:

  1. Editing themes and plugins directly can render your site unusable. It is vital that you have a backup of the file you are changing, AND file access to your webserver to revert to your backup if needed.
  2. The change will affect all your users who are using the plugin or theme that you are changing

So, there are very good reasons why you should not make ad-hoc changes to plugins and themes. However, if you feel that bypassing version control is occasionally worth the risk, here is how to unveil your hidden file editor.

  1. Create a file, e.g. file-editor-enabler.php, with the following code:

    <?php
    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");' ));
    ?>

  2. Upload that file to the mu-plugins directory.

That’s all you need to do. Any code put in the mu-plugins directory is automatically executed.

My thanks go to dsader at the WordPress MU forum for this excellent tip.

{[@adsense.double250]}

One thought on “WordPress MU File Editor Revealed

Comments are closed.