WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/09/2021 02:15:23 AM (2 months ago)
Author:
noisysocks
Message:

Add Site Editor and PHP changes from Gutenberg 10.1 - 11.9

  • First pass at adding the site editor from the Gutenberg plugin to wp-admin/site-editor.php.
  • Adds miscellaneous PHP changes from Gutenberg 10.1 - 11.9.

Follows [52042].
See #54337.
Props youknowriad, aristath, hellofromtonya, gziolo.

File:
1 edited

Legend:

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

    r51022 r52069  
    203203    $submenu['themes.php'][5] = array( sprintf( __( 'Themes %s' ), $count ), $appearance_cap, 'themes.php' );
    204204
     205if ( wp_is_block_template_theme() ) {
     206    $submenu['themes.php'][6] = array(
     207        sprintf(
     208            /* translators: %s: "beta" label */
     209            __( 'Editor %s' ),
     210            '<span class="awaiting-mod">' . __( 'beta' ) . '</span>'
     211        ),
     212        'edit_theme_options',
     213        'site-editor.php',
     214    );
     215}
     216
     217// Hide Customize link on block themes unless a plugin or theme is using
     218// customize_register to add a setting.
     219if ( ! wp_is_block_template_theme() || has_action( 'customize_register' ) ) {
    205220    $customize_url            = add_query_arg( 'return', urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ), 'customize.php' );
    206     $submenu['themes.php'][6] = array( __( 'Customize' ), 'customize', esc_url( $customize_url ), '', 'hide-if-no-customize' );
     221    $submenu['themes.php'][7] = array( __( 'Customize' ), 'customize', esc_url( $customize_url ), '', 'hide-if-no-customize' );
     222}
    207223
    208224if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) {
Note: See TracChangeset for help on using the changeset viewer.