Changeset 53024
- Timestamp:
- 03/29/2022 07:07:15 PM (3 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/wp/customize/controls.js
r52003 r53024 8336 8336 8337 8337 /** 8338 * Displays a Site Editor notification when a block theme is activated. 8339 * 8340 * @since 4.9.0 8341 * 8342 * @param {string} [notification] - A notification to display. 8343 * @return {void} 8344 */ 8345 function addSiteEditorNotification( notification ) { 8346 api.notifications.add( new api.Notification( 'site_editor_block_theme_notice', { 8347 message: notification, 8348 type: 'info', 8349 dismissible: false, 8350 render: function() { 8351 var notification = api.Notification.prototype.render.call( this ), 8352 button = notification.find( 'button.switch-to-editor' ); 8353 8354 button.on( 'click', function( event ) { 8355 event.preventDefault(); 8356 location.assign( button.data( 'action' ) ); 8357 } ); 8358 8359 return notification; 8360 } 8361 } ) ); 8362 } 8363 8364 /** 8338 8365 * Dismiss autosave. 8339 8366 * … … 8408 8435 if ( api.settings.changeset.latestAutoDraftUuid || api.settings.changeset.hasAutosaveRevision ) { 8409 8436 addAutosaveRestoreNotification(); 8437 } 8438 var shouldDisplayBlockThemeNotification = !! parseInt( $( '#customize-info' ).data( 'block-theme' ), 10 ); 8439 if (shouldDisplayBlockThemeNotification) { 8440 addSiteEditorNotification( api.l10n.blockThemeNotification ); 8410 8441 } 8411 8442 })(); -
trunk/src/wp-admin/css/customize-controls.css
r51996 r53024 1731 1731 top: 50%; 1732 1732 margin-top: -14px; 1733 font-weight: 400; 1734 } 1735 1736 #customize-notifications-area .notification-message button.switch-to-editor { 1737 display: block; 1738 margin-top: 6px; 1733 1739 font-weight: 400; 1734 1740 } -
trunk/src/wp-admin/customize.php
r52053 r53024 223 223 </div> 224 224 <div class="wp-full-overlay-sidebar-content" tabindex="-1"> 225 <div id="customize-info" class="accordion-section customize-info" >225 <div id="customize-info" class="accordion-section customize-info" data-block-theme="<?php echo (int) wp_is_block_theme(); ?>"> 226 226 <div class="accordion-section-title"> 227 227 <span class="preview-notice"> … … 236 236 <p> 237 237 <?php 238 _e( 'The Customizer allows you to preview changes to your site before publishing them. You can navigate to different pages on your site within the preview. Edit shortcuts are shown for some editable elements. ' );238 _e( 'The Customizer allows you to preview changes to your site before publishing them. You can navigate to different pages on your site within the preview. Edit shortcuts are shown for some editable elements. The Customizer is intended for use with non-block themes.' ); 239 239 ?> 240 240 </p> -
trunk/src/wp-includes/script-loader.php
r53015 r53024 1155 1155 $scripts->add( 'customize-views', '/wp-includes/js/customize-views.js', array( 'jquery', 'underscore', 'imgareaselect', 'customize-models', 'media-editor', 'media-views' ), false, 1 ); 1156 1156 $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' ); 1157 1158 did_action( 'init' ) && $scripts->localize( 1158 1159 'customize-controls', … … 1222 1223 'invalidDate' => __( 'Invalid date.' ), 1223 1224 '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 ), 1224 1237 ) 1225 1238 );
Note: See TracChangeset
for help on using the changeset viewer.