diff --git src/wp-includes/customize/class-wp-customize-selective-refresh.php src/wp-includes/customize/class-wp-customize-selective-refresh.php
index 73af9c9..2342aef 100644
|
|
final class WP_Customize_Selective_Refresh { |
188 | 188 | 'clickEditWidget' => __( 'Click to edit this widget.' ), |
189 | 189 | 'clickEditTitle' => __( 'Click to edit the site title.' ), |
190 | 190 | 'clickEditMisc' => __( 'Click to edit this element.' ), |
191 | | 'editShortcutVisibilityToggle' => __( 'Toggle edit shortcuts' ), |
192 | 191 | /* translators: %s: document.write() */ |
193 | 192 | 'badDocumentWrite' => sprintf( __( '%s is forbidden' ), 'document.write()' ), |
194 | 193 | ), |
diff --git src/wp-includes/js/customize-selective-refresh.js src/wp-includes/js/customize-selective-refresh.js
index 2b8cbef..70e2b96 100644
|
|
wp.customize.selectiveRefresh = ( function( $, api ) { |
1006 | 1006 | } ); |
1007 | 1007 | |
1008 | 1008 | api.preview.bind( 'active', function() { |
1009 | | var body = $( document.body ), buttonText, $editShortcutVisibilityButton; |
1010 | | |
1011 | | // Add invisible button to toggle editShortcutVisibility. |
1012 | | if ( $( '.edit-shortcut-visibility-button' ).length < 1 ) { |
1013 | | buttonText = self.data.l10n.editShortcutVisibilityToggle || 'Toggle edit shortcuts'; |
1014 | | $editShortcutVisibilityButton = $( '<button type="button" class="edit-shortcut-visibility-button screen-reader-text"></button>' ); |
1015 | | $editShortcutVisibilityButton.text( buttonText ); |
1016 | | $editShortcutVisibilityButton.on( 'click', function() { |
1017 | | api.selectiveRefresh.editShortcutVisibility.set( 'visible' === api.selectiveRefresh.editShortcutVisibility.get() ? 'hidden' : 'visible' ); |
1018 | | } ); |
1019 | | body.prepend( $editShortcutVisibilityButton ); |
1020 | | } |
1021 | 1009 | |
1022 | 1010 | // Make all partials ready. |
1023 | 1011 | self.partial.each( function( partial ) { |