diff --git src/wp-admin/customize.php src/wp-admin/customize.php
index d6cec32..04046b6 100644
|
|
|
do_action( 'customize_controls_print_scripts' ); |
| 127 | 127 | ?> |
| 128 | 128 | <span class="spinner"></span> |
| 129 | 129 | <a class="customize-controls-preview-toggle" href="#"> |
| 130 | | <span class="controls"><?php _e( 'Customize' ); ?></span> |
| 131 | | <span class="preview"><?php _e( 'Preview' ); ?></span> |
| | 130 | <span class="controls"><?php esc_html_e( 'Customize' ); ?></span> |
| | 131 | <span class="preview"><?php esc_html_e( 'Preview' ); ?></span> |
| 132 | 132 | </a> |
| 133 | 133 | <a class="customize-controls-close" href="<?php echo esc_url( $return ); ?>"> |
| 134 | | <span class="screen-reader-text"><?php _e( 'Cancel' ); ?></span> |
| | 134 | <span class="screen-reader-text"><?php esc_html_e( 'Cancel' ); ?></span> |
| 135 | 135 | </a> |
| 136 | | <span class="control-panel-back" tabindex="-1"><span class="screen-reader-text"><?php _e( 'Back' ); ?></span></span> |
| | 136 | <span class="control-panel-back" tabindex="-1"><span class="screen-reader-text"><?php esc_html_e( 'Back' ); ?></span></span> |
| 137 | 137 | </div> |
| 138 | 138 | |
| 139 | 139 | <div id="widgets-right"><!-- For Widget Customizer, many widgets try to look for instances under div#widgets-right, so we have to add that ID to a container div in the Customizer for compat --> |
| … |
… |
do_action( 'customize_controls_print_scripts' ); |
| 141 | 141 | <div id="customize-info" class="accordion-section"> |
| 142 | 142 | <div class="accordion-section-title" aria-label="<?php esc_attr_e( 'Customizer Options' ); ?>" tabindex="0"> |
| 143 | 143 | <span class="preview-notice"><?php |
| 144 | | echo sprintf( __( 'You are customizing %s' ), '<strong class="theme-name site-title">' . get_bloginfo( 'name' ) . '</strong>' ); |
| | 144 | echo sprintf( esc_html__( 'You are customizing %s' ), '<strong class="theme-name site-title">' . get_bloginfo( 'name', 'display' ) . '</strong>' ); |
| 145 | 145 | ?></span> |
| 146 | 146 | </div> |
| 147 | 147 | <div class="accordion-section-content"><?php |
| 148 | | echo __( 'The Customizer allows you to preview changes to your site before publishing them. You can also navigate to different pages on your site to preview them.' ); |
| | 148 | esc_html_e( 'The Customizer allows you to preview changes to your site before publishing them. You can also navigate to different pages on your site to preview them.' ); |
| 149 | 149 | ?></div> |
| 150 | 150 | </div> |
| 151 | 151 | |
| … |
… |
do_action( 'customize_controls_print_scripts' ); |
| 156 | 156 | </div> |
| 157 | 157 | |
| 158 | 158 | <div id="customize-footer-actions" class="wp-full-overlay-footer"> |
| 159 | | <a href="#" class="collapse-sidebar button-secondary" title="<?php esc_attr_e('Collapse Sidebar'); ?>"> |
| | 159 | <a href="#" class="collapse-sidebar button-secondary" title="<?php esc_attr_e( 'Collapse Sidebar' ); ?>"> |
| 160 | 160 | <span class="collapse-sidebar-arrow"></span> |
| 161 | | <span class="collapse-sidebar-label"><?php _e('Collapse'); ?></span> |
| | 161 | <span class="collapse-sidebar-label"><?php esc_html_e( 'Collapse' ); ?></span> |
| 162 | 162 | </a> |
| 163 | 163 | </div> |
| 164 | 164 | </form> |
diff --git src/wp-admin/includes/theme.php src/wp-admin/includes/theme.php
index 3ab1732..dd0cf36 100644
|
|
|
function customize_themes_print_templates() { |
| 498 | 498 | <div class="theme-backdrop"></div> |
| 499 | 499 | <div class="theme-wrap"> |
| 500 | 500 | <div class="theme-header"> |
| 501 | | <button type="button" class="left dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Show previous theme' ); ?></span></button> |
| 502 | | <button type="button" class="right dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Show next theme' ); ?></span></button> |
| 503 | | <button type="button" class="close dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Close details dialog' ); ?></span></button> |
| | 501 | <button type="button" class="left dashicons dashicons-no"><span class="screen-reader-text"><?php esc_html_e( 'Show previous theme' ); ?></span></button> |
| | 502 | <button type="button" class="right dashicons dashicons-no"><span class="screen-reader-text"><?php esc_html_e( 'Show next theme' ); ?></span></button> |
| | 503 | <button type="button" class="close dashicons dashicons-no"><span class="screen-reader-text"><?php esc_html_e( 'Close details dialog' ); ?></span></button> |
| 504 | 504 | </div> |
| 505 | 505 | <div class="theme-about"> |
| 506 | 506 | <div class="theme-screenshots"> |
| … |
… |
function customize_themes_print_templates() { |
| 513 | 513 | |
| 514 | 514 | <div class="theme-info"> |
| 515 | 515 | <# if ( data.active ) { #> |
| 516 | | <span class="current-label"><?php _e( 'Current Theme' ); ?></span> |
| | 516 | <span class="current-label"><?php esc_html_e( 'Current Theme' ); ?></span> |
| 517 | 517 | <# } #> |
| 518 | | <h3 class="theme-name">{{{ data.name }}}<span class="theme-version"><?php printf( __( 'Version: %s' ), '{{ data.version }}' ); ?></span></h3> |
| 519 | | <h4 class="theme-author"><?php printf( __( 'By %s' ), '{{{ data.authorAndUri }}}' ); ?></h4> |
| | 518 | <h3 class="theme-name">{{ data.name }}<span class="theme-version"><?php printf( esc_html__( 'Version: %s' ), '{{ data.version }}' ); ?></span></h3> |
| | 519 | <h4 class="theme-author"><?php printf( esc_html__( 'By %s' ), '{{{ data.authorAndUri }}}' ); ?></h4> |
| 520 | 520 | <p class="theme-description">{{{ data.description }}}</p> |
| 521 | 521 | |
| 522 | 522 | <# if ( data.parent ) { #> |
| 523 | | <p class="parent-theme"><?php printf( __( 'This is a child theme of %s.' ), '<strong>{{{ data.parent }}}</strong>' ); ?></p> |
| | 523 | <p class="parent-theme"><?php printf( esc_html__( 'This is a child theme of %s.' ), '<strong>{{ data.parent }}</strong>' ); ?></p> |
| 524 | 524 | <# } #> |
| 525 | 525 | |
| 526 | 526 | <# if ( data.tags ) { #> |
| 527 | | <p class="theme-tags"><span><?php _e( 'Tags:' ); ?></span> {{ data.tags }}</p> |
| | 527 | <p class="theme-tags"><span><?php esc_html_e( 'Tags:' ); ?></span> {{ data.tags }}</p> |
| 528 | 528 | <# } #> |
| 529 | 529 | </div> |
| 530 | 530 | </div> |
| … |
… |
function customize_themes_print_templates() { |
| 532 | 532 | <div class="theme-actions"> |
| 533 | 533 | <# if ( ! data.active ) { #> |
| 534 | 534 | <div class="inactive-theme"> |
| 535 | | <a href="<?php echo add_query_arg( 'theme', '{{ data.id }}', remove_query_arg( 'theme' ) ); ?>" target="_top" class="button button-primary"><?php _e( 'Live Preview' ); ?></a> |
| | 535 | <a href="<?php echo add_query_arg( 'theme', '{{ data.id }}', remove_query_arg( 'theme' ) ); ?>" target="_top" class="button button-primary"><?php esc_html_e( 'Live Preview' ); ?></a> |
| 536 | 536 | </div> |
| 537 | 537 | <# } #> |
| 538 | 538 | </div> |
diff --git src/wp-admin/js/customize-controls.js src/wp-admin/js/customize-controls.js
index d95287c..ac2af19 100644
|
|
|
|
| 814 | 814 | * @param {Object} theme |
| 815 | 815 | */ |
| 816 | 816 | showDetails: function ( theme, callback ) { |
| 817 | | var section = this; |
| | 817 | var section = this, |
| | 818 | overlay = section.overlay; |
| 818 | 819 | callback = callback || function(){}; |
| 819 | 820 | section.currentTheme = theme.id; |
| 820 | | section.overlay.html( section.template( theme ) ) |
| 821 | | .fadeIn( 'fast' ) |
| 822 | | .focus(); |
| | 821 | overlay.html( section.template( theme ) ); |
| | 822 | overlay.fadeIn( 'fast' ); |
| | 823 | overlay.focus(); |
| 823 | 824 | $( 'body' ).addClass( 'modal-open' ); |
| 824 | 825 | section.containFocus( section.overlay ); |
| 825 | 826 | section.updateLimits(); |
| … |
… |
|
| 1800 | 1801 | * @since 4.2.0 |
| 1801 | 1802 | */ |
| 1802 | 1803 | filter: function( term ) { |
| 1803 | | var control = this, |
| 1804 | | haystack = control.params.theme.name + ' ' + |
| 1805 | | control.params.theme.description + ' ' + |
| 1806 | | control.params.theme.tags + ' ' + |
| 1807 | | control.params.theme.author; |
| 1808 | | haystack = haystack.toLowerCase().replace( '-', ' ' ); |
| | 1804 | var control = this, haystack, haystackParts; |
| | 1805 | haystackParts = _.values( _.pick( control.params.theme, [ 'name', 'description', 'tags', 'author' ] ) ); |
| | 1806 | haystack = haystackParts.join( ' ' ).toLowerCase().replace( '-', ' ' ); |
| 1809 | 1807 | if ( -1 !== haystack.search( term ) ) { |
| 1810 | 1808 | control.activate(); |
| 1811 | 1809 | } else { |
diff --git src/wp-includes/class-wp-customize-control.php src/wp-includes/class-wp-customize-control.php
index 4447bc2..6d972f9 100644
|
|
|
class WP_Customize_Theme_Control extends WP_Customize_Control { |
| 1158 | 1158 | <# } else { #> |
| 1159 | 1159 | <div class="theme-screenshot blank"></div> |
| 1160 | 1160 | <# } #> |
| 1161 | | <span class="more-details" id="{{ data.theme.id }}-action"><?php _e( 'Theme Details' ); ?></span> |
| 1162 | | <div class="theme-author"><?php printf( __( 'By %s' ), '{{ data.theme.author }}' ); ?></div> |
| | 1161 | <span class="more-details" id="{{ data.theme.id }}-action"><?php esc_html_e( 'Theme Details' ); ?></span> |
| | 1162 | <div class="theme-author"><?php printf( esc_html__( 'By %s' ), '{{ data.theme.author }}' ); ?></div> |
| 1163 | 1163 | |
| 1164 | 1164 | <# if ( data.theme.active ) { #> |
| 1165 | | <h3 class="theme-name" id="{{ data.theme.id }}-name"><span><?php _ex( 'Previewing:', 'theme' ); ?></span> {{ data.theme.name }}</h3> |
| | 1165 | <h3 class="theme-name" id="{{ data.theme.id }}-name"><span><?php echo esc_html( _x( 'Previewing:', 'theme' ) ); ?></span> {{ data.theme.name }}</h3> |
| 1166 | 1166 | <# } else { #> |
| 1167 | 1167 | <h3 class="theme-name" id="{{ data.theme.id }}-name">{{ data.theme.name }}</h3> |
| 1168 | 1168 | <# } #> |
| 1169 | 1169 | |
| 1170 | 1170 | <# if ( ! data.theme.active ) { #> |
| 1171 | 1171 | <div class="theme-actions"> |
| 1172 | | <a class="button" href="<?php echo add_query_arg( 'theme', '{{ data.theme.id }}', remove_query_arg( 'theme' ) ); ?>" target="_top"><?php _e( 'Live Preview' ); ?></a> |
| | 1172 | <a class="button" href="<?php echo add_query_arg( 'theme', '{{ data.theme.id }}', remove_query_arg( 'theme' ) ); ?>" target="_top"><?php esc_html_e( 'Live Preview' ); ?></a> |
| 1173 | 1173 | </div> |
| 1174 | 1174 | <# } #> |
| 1175 | 1175 | </div> |
| … |
… |
class WP_Customize_New_Theme_Control extends WP_Customize_Control { |
| 1192 | 1192 | * @since 4.2.0 |
| 1193 | 1193 | */ |
| 1194 | 1194 | public function render() { |
| 1195 | | if ( is_multisite() || ! current_user_can( 'install_themes') ) { |
| | 1195 | if ( is_multisite() || ! current_user_can( 'install_themes' ) ) { |
| 1196 | 1196 | return; |
| 1197 | 1197 | } |
| 1198 | 1198 | ?> |
| 1199 | 1199 | <div class="theme add-new-theme"> |
| 1200 | | <a href="<?php echo admin_url( 'theme-install.php' ); ?>" target="_top"> |
| | 1200 | <a href="<?php echo esc_url( admin_url( 'theme-install.php' ) ); ?>" target="_top"> |
| 1201 | 1201 | <div class="theme-screenshot"> |
| 1202 | 1202 | <span></span> |
| 1203 | 1203 | </div> |
| 1204 | | <h3 class="theme-name"><?php _e( 'Add New Theme' ); ?></h3> |
| | 1204 | <h3 class="theme-name"><?php esc_html_e( 'Add New Theme' ); ?></h3> |
| 1205 | 1205 | </a> |
| 1206 | 1206 | </div> |
| 1207 | 1207 | <?php |
diff --git src/wp-includes/class-wp-customize-manager.php src/wp-includes/class-wp-customize-manager.php
index ffdb3f3..be14114 100644
|
|
|
final class WP_Customize_Manager { |
| 1124 | 1124 | /* Themes */ |
| 1125 | 1125 | |
| 1126 | 1126 | $this->add_section( new WP_Customize_Themes_Section( $this, 'themes', array( |
| 1127 | | 'title' => sprintf( __( 'Theme: %s' ), $this->theme()->display('Name') ), |
| | 1127 | 'title' => sprintf( __( 'Theme: %s' ), $this->theme()->display( 'Name' ) ), |
| 1128 | 1128 | 'capability' => 'switch_themes', |
| 1129 | 1129 | 'priority' => 0, |
| 1130 | 1130 | ) ) ); |
diff --git src/wp-includes/class-wp-customize-section.php src/wp-includes/class-wp-customize-section.php
index b824173..01a4d2e 100644
|
|
|
class WP_Customize_Themes_Section extends WP_Customize_Section { |
| 343 | 343 | <li id="accordion-section-<?php echo esc_attr( $this->id ); ?>" class="<?php echo esc_attr( $classes ); ?>"> |
| 344 | 344 | <h3 class="accordion-section-title" tabindex="0"> |
| 345 | 345 | <?php echo esc_html( $this->title ); ?> |
| 346 | | <span class="screen-reader-text"><?php _e( 'Press return or enter to expand' ); ?></span> |
| | 346 | <span class="screen-reader-text"><?php esc_html_e( 'Press return or enter to expand' ); ?></span> |
| 347 | 347 | </h3> |
| 348 | 348 | <span class="control-panel-back themes-panel-back" tabindex="-1"><span class="screen-reader-text"><?php _e( 'Back' ); ?></span></span> |
| 349 | 349 | <div class="customize-themes-panel control-panel-content themes-php"> |
| 350 | 350 | <h2><?php esc_html_e( 'Themes' ); ?> |
| 351 | 351 | <span class="title-count theme-count"><?php echo count( $this->controls ) - 1; ?></span> |
| 352 | 352 | <?php if ( ! is_multisite() && current_user_can( 'install_themes' ) ) : ?> |
| 353 | | <a href="<?php echo admin_url( 'theme-install.php' ); ?>" target="_top" class="add-new-h2"><?php echo esc_html_x( 'Add New', 'Add new theme' ); ?></a> |
| | 353 | <a href="<?php echo esc_url( admin_url( 'theme-install.php' ) ); ?>" target="_top" class="add-new-h2"><?php echo esc_html_x( 'Add New', 'Add new theme' ); ?></a> |
| 354 | 354 | <?php endif; ?> |
| 355 | 355 | </h2> |
| 356 | 356 | <div class="theme-overlay" tabindex="0" role="dialog" aria-label="<?php esc_attr_e( 'Theme details' ); ?>"></div> |
| 357 | 357 | <div id="customize-container"></div> |
| 358 | 358 | <?php if ( 6 < count( $this->controls ) ) : ?> |
| 359 | 359 | <p><label for="themes-filter"> |
| 360 | | <span class="screen-reader-text"><?php _e( 'Search installed themes...' ); ?></span> |
| | 360 | <span class="screen-reader-text"><?php esc_html_e( 'Search installed themes...' ); ?></span> |
| 361 | 361 | <input type="search" id="themes-filter" placeholder="<?php esc_attr_e( 'Search installed themes...' ); ?>" /> |
| 362 | 362 | </label></p> |
| 363 | 363 | <?php endif; ?> |