mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-03 20:24:26 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@53024 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1154,6 +1154,7 @@ function wp_default_scripts( $scripts ) {
|
||||
$scripts->add( 'customize-models', '/wp-includes/js/customize-models.js', array( 'underscore', 'backbone' ), false, 1 );
|
||||
$scripts->add( 'customize-views', '/wp-includes/js/customize-views.js', array( 'jquery', 'underscore', 'imgareaselect', 'customize-models', 'media-editor', 'media-views' ), false, 1 );
|
||||
$scripts->add( 'customize-controls', "/wp-admin/js/customize-controls$suffix.js", array( 'customize-base', 'wp-a11y', 'wp-util', 'jquery-ui-core' ), false, 1 );
|
||||
$switch_to_site_editor_label = __( 'Use Site Editor' );
|
||||
did_action( 'init' ) && $scripts->localize(
|
||||
'customize-controls',
|
||||
'_wpCustomizeControlsL10n',
|
||||
@@ -1221,6 +1222,18 @@ function wp_default_scripts( $scripts ) {
|
||||
'publishSettings' => __( 'Publish Settings' ),
|
||||
'invalidDate' => __( 'Invalid date.' ),
|
||||
'invalidValue' => __( 'Invalid value.' ),
|
||||
'blockThemeNotification' => sprintf(
|
||||
/* translators: 1. %s: URL to the localized version of https://wordpress.org/support/article/site-editor/, 2: HTML Button. */
|
||||
__( 'Hurray! Your theme supports Full Site Editing with blocks. <a href="%1$s" target="_blank">Tell me more</a>. %2$s' ),
|
||||
__( 'https://wordpress.org/support/article/site-editor/' ),
|
||||
sprintf(
|
||||
/* translators: 1: URL to the Site Editor admin screen, 2: Button label, 3: Button text. */
|
||||
'<button type="button" data-action="%1$s" class="button switch-to-editor" aria-label="%2$s">%3$s</button>',
|
||||
esc_url( admin_url( 'site-editor.php' ) ),
|
||||
$switch_to_site_editor_label,
|
||||
$switch_to_site_editor_label
|
||||
)
|
||||
),
|
||||
)
|
||||
);
|
||||
$scripts->add( 'customize-selective-refresh', "/wp-includes/js/customize-selective-refresh$suffix.js", array( 'jquery', 'wp-util', 'customize-preview' ), false, 1 );
|
||||
|
||||
Reference in New Issue
Block a user