Make WordPress Core

Ticket #54382: 54382-2.patch

File 54382-2.patch, 1.7 KB (added by poena, 4 years ago)

Alternative 2, move both plugin editor and theme editor menu items to tools.

  • src/wp-admin/menu.php

     
    239239
    240240unset( $appearance_cap );
    241241
    242 // Add 'Theme Editor' to the bottom of the Appearance menu.
     242// Add 'Theme Editor' to the bottom of the Tools menu.
    243243if ( ! is_multisite() ) {
    244244        add_action( 'admin_menu', '_add_themes_utility_last', 101 );
    245245}
    246246/**
    247  * Adds the 'Theme Editor' link to the bottom of the Appearance menu.
     247 * Adds the 'Theme Editor' link to the bottom of the Tools menu.
    248248 *
    249249 * @access private
    250250 * @since 3.0.0
     251 * @since 5.9.0 Menu item moved from Appearance (themes.php) to Tools (tools.php).
    251252 */
    252253function _add_themes_utility_last() {
    253254        // Must use API on the admin_menu hook, direct modification is only possible on/before the _admin_menu hook.
    254         add_submenu_page( 'themes.php', __( 'Theme Editor' ), __( 'Theme Editor' ), 'edit_themes', 'theme-editor.php' );
     255        add_submenu_page( 'tools.php', __( 'Theme Editor' ), __( 'Theme Editor' ), 'edit_themes', 'theme-editor.php' );
    255256}
    256257
    257258$count = '';
     
    271272
    272273$submenu['plugins.php'][5] = array( __( 'Installed Plugins' ), 'activate_plugins', 'plugins.php' );
    273274
     275// @since 5.9.0 Plugin Editor menu item moved from Plugins (plugins.php) to Tools (tools.php).
    274276if ( ! is_multisite() ) {
    275277        /* translators: Add new plugin. */
    276278        $submenu['plugins.php'][10] = array( _x( 'Add New', 'plugin' ), 'install_plugins', 'plugin-install.php' );
    277         $submenu['plugins.php'][15] = array( __( 'Plugin Editor' ), 'edit_plugins', 'plugin-editor.php' );
     279        $submenu['tools.php'][40] = array( __( 'Plugin Editor' ), 'edit_plugins', 'plugin-editor.php' );
    278280}
    279281
    280282unset( $update_data );