WordPress.org

Make WordPress Core

Changeset 52178


Ignore:
Timestamp:
11/16/2021 04:43:49 AM (2 months ago)
Author:
hellofromTonya
Message:

Administration: Restores "Customize" menu item for non-block themes and moves for block themes.

For themes without non-block themes (i.e. without a /block-templates/index.html file), restores the "Customize" menu item under "Appearance" menu to its original location of 6.

For block themes, moves it to position 8, as "Styles" is in position 7 as of [52158].

Follow-up to [29026], [52069], [52158].

Props poena, davidbaumwald, sabernhardt, hellofromTonya.
Fixes #54418.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/menu.php

    r52158 r52178  
    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
Note: See TracChangeset for help on using the changeset viewer.