• Resolved mingya

    (@mingya)


    Anyone knows how to remove theme editor from admin menu (WordPress 3.0.4)?

    Previously it has a submenu hook [10] for theme.php, but now it’s being added to the menu using the following inside /wp-admin/menu.php:

    add_action('admin_menu', '_add_themes_utility_last', 101);

    Tried using remove_action, but doesn’t work.

    Please help.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Try this within a plugin or functions file:

    add_action('admin_menu', 'my_remove_menu_elements', 102);
    
    function my_remove_menu_elements()
    {
    	remove_submenu_page( 'themes.php', 'theme-editor.php' );
    }

    it seems as of the latest update to the admin gui the
    remove_submenu_page( 'themes.php', 'theme-editor.php' );
    does not work. however
    remove_submenu_page('plugins.php', 'plugin-editor.php' );
    does work

    any idea what changed?

    Wes

    (@therealwesfoster)

    You need to call that action in admin_init, not admin_menu

    So:

    add_action('admin_init', 'my_remove_menu_elements', 102);
    
    function my_remove_menu_elements()
    {
    	remove_submenu_page( 'themes.php', 'theme-editor.php' );
    }

    🙂

    You need to call that action in admin_init, not admin_menu

    answer

    THANK YOU!

    Wes

    (@therealwesfoster)

    No problem, glad to help. Be sure to mark this post as “solved” so it can help others with this problem.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to remove theme editor submenu?’ is closed to new replies.