Make WordPress Core


Ignore:
Timestamp:
03/29/2022 07:07:15 PM (2 years ago)
Author:
audrasjb
Message:

Customizer: When a block theme is active, add an information about Site Editor in the Customizer.

This change adds an information notice to the customizer when a block theme is active and the customizer is also available (for example when a plugin activates it), to encourage people to use the Site Editor for the best full site customization experience.

Props ironprogrammer, antonvlasenko, Clorith, audrasjb, psmits1567, tobifjellner, costdev, webcommsat.
Fixes #54939.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

    r53015 r53024  
    11551155    $scripts->add( 'customize-views', '/wp-includes/js/customize-views.js', array( 'jquery', 'underscore', 'imgareaselect', 'customize-models', 'media-editor', 'media-views' ), false, 1 );
    11561156    $scripts->add( 'customize-controls', "/wp-admin/js/customize-controls$suffix.js", array( 'customize-base', 'wp-a11y', 'wp-util', 'jquery-ui-core' ), false, 1 );
     1157    $switch_to_site_editor_label = __( 'Use Site Editor' );
    11571158    did_action( 'init' ) && $scripts->localize(
    11581159        'customize-controls',
     
    12221223            'invalidDate'             => __( 'Invalid date.' ),
    12231224            'invalidValue'            => __( 'Invalid value.' ),
     1225            'blockThemeNotification'  => sprintf(
     1226                /* translators: 1. %s: URL to the localized version of https://wordpress.org/support/article/site-editor/, 2: HTML Button. */
     1227                __( 'Hurray! Your theme supports Full Site Editing with blocks. <a href="%1$s" target="_blank">Tell me more</a>. %2$s' ),
     1228                __( 'https://wordpress.org/support/article/site-editor/' ),
     1229                sprintf(
     1230                    /* translators: 1: URL to the Site Editor admin screen, 2: Button label, 3: Button text. */
     1231                    '<button type="button" data-action="%1$s" class="button switch-to-editor" aria-label="%2$s">%3$s</button>',
     1232                    esc_url( admin_url( 'site-editor.php' ) ),
     1233                    $switch_to_site_editor_label,
     1234                    $switch_to_site_editor_label
     1235                )
     1236            ),
    12241237        )
    12251238    );
Note: See TracChangeset for help on using the changeset viewer.