Make WordPress Core

Ticket #54418: 54418.position8.diff

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

option to fix both issues

  • src/wp-admin/menu.php

     
    223223// Hide Customize link on block themes unless a plugin or theme is using
    224224// customize_register to add a setting.
    225225if ( ! wp_is_block_template_theme() || has_action( 'customize_register' ) ) {
    226         $customize_url            = add_query_arg( 'return', urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ), 'customize.php' );
    227         $submenu['themes.php'][7] = array( __( 'Customize' ), 'customize', esc_url( $customize_url ), '', 'hide-if-no-customize' );
     226        $customize_url = add_query_arg( 'return', urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ), 'customize.php' );
     227        $position      = wp_is_block_template_theme() ? 8 : 6;
     228
     229        $submenu['themes.php'][ $position ] = array( __( 'Customize' ), 'customize', esc_url( $customize_url ), '', 'hide-if-no-customize' );
    228230}
    229231
    230232if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) {