The MU forums have moved to WordPress.org

Enable Theme Editor in WPMU 2.8.4 (I'm the only user) (12 posts)

  1. Elkana
    Member
    Posted 14 years ago #

    Hello everyone,
    I've searched on the forum to get the Theme Editor working in my WPMU 2.8.4 but I couldn't find an right solution. I've read that you don't may want to enable it because than everybody can edit themes. I am the only user on my WPMU (I just use it for multiple blogs for my own) so I really want to edit themes when I want to - online.

    Can anybody tell me how I get the Editor working? I've used the Theme Editor in WP many times and before I was moved to WP I used the editor so many times in Nucleus. I really need it! So please, don't say that I don't may activate it :)

    Thanks in advance!

  2. dsader
    Member
    Posted 14 years ago #

    WPMU has 2 functions to disable theme-editor.php, plugin-editor.php and allow only SiteAdmin to see theme-install.php and plugin-install.php and their menus.

    Pages are disable with the "disable_some_pages" function, and the menus are unset with the "wpmu_menu" function (in wp-admin/includes/mu.php).

    URL access to the disabled pages can be restored by using a remove_action. The following code adds the menus, too.

    Drop this into a .php file in your mu-plugins folder

    <?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");' ));
    ?>
  3. Elkana
    Member
    Posted 14 years ago #

    Thanks for your replay. What should be the name of the php file?

  4. kgraeme
    Member
    Posted 14 years ago #

    elkana-enable-theme-editor-so-i-can-edit-themes-in-wordpress-mu.php

    Or anything else that makes sense to you. :-)

  5. Elkana
    Member
    Posted 14 years ago #

    Very cool! Yay! :D Thank you very much.

  6. aberean
    Member
    Posted 14 years ago #

    This is the best solution, Thank You.

    Also, is there a similar way to consolidate taxonomy? What I mean is: I am the only admin on MU 2.8.4, I want all my blogs to share catagory and tag from the main blog db tables (including the ability to create and delete as normal), is this possible?

  7. gazouteast
    Member
    Posted 14 years ago #

    Did the above "plugin" and it worked like a charm - Editors return to admin menus, files edit (verified on server file editor) etc etc

    but the changes to index.php are simply not revealing on the site - using firebug shows that no changes have been made to the source of the displayed index.php

    I'm sort of figuring this may be a caching issue with the LAN proxy, or with the browser, but I'm not getting it on any of my WP standalone sites, only on WPMU, which sort of negates it being a caching issue.

    Can anyone give me any pointers on this as I'm at the banging head on wall stage with it.

    Thanks
    Gaz

  8. gazouteast
    Member
    Posted 14 years ago #

    p.s. - I've also noticed here on the WPMU site, that after logging in, I have to refresh the page to clear the not-logged-in page from the browser

    Is this a known issue with WPMU sites generally?

  9. andrea_r
    Moderator
    Posted 14 years ago #

    Nope, not havign either issue.

    The index.php you're changing - are you changing the index.php of the theme that is active on that blog? (ie; the main site blog)

  10. gazouteast
    Member
    Posted 14 years ago #

    Yup

  11. allyanders
    Member
    Posted 14 years ago #

    dsader, tried this. Now I'm getting the following error message: Warning: Cannot modify header information - headers already sent by (output started at /home/pix/workshop/wp-admin/includes/mu.php:1) in /home/pix/workshop/wp-includes/pluggable.php on line 865 (even after deleting the file I created.)

  12. andrea_r
    Moderator
    Posted 14 years ago #

    There's a blank line at the bottom of one of the files you edited.

About this Topic