Make WordPress Core

Ticket #54418: 54418.diff

File 54418.diff, 1.1 KB (added by hellofromTonya, 3 years ago)

For classic themes, leave Customize menu item at position 6 ([52069] moved it to 7).

  • src/wp-admin/menu.php

    diff --git a/src/wp-admin/menu.php b/src/wp-admin/menu.php
    index 94f479fb8c..e9bf0a9637 100644
    a b if ( wp_is_block_template_theme() ) { 
    217217// Hide Customize link on block themes unless a plugin or theme is using
    218218// customize_register to add a setting.
    219219if ( ! wp_is_block_template_theme() || has_action( 'customize_register' ) ) {
    220         $customize_url            = add_query_arg( 'return', urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ), 'customize.php' );
    221         $submenu['themes.php'][7] = array( __( 'Customize' ), 'customize', esc_url( $customize_url ), '', 'hide-if-no-customize' );
     220        $customize_url = add_query_arg( 'return', urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ), 'customize.php' );
     221        $position      =  wp_is_block_template_theme() ? 7 : 6;
     222
     223        $submenu['themes.php'][ $position ] = array( __( 'Customize' ), 'customize', esc_url( $customize_url ), '', 'hide-if-no-customize' );
    222224}
    223225
    224226if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) {