Customize: Revert theme install feature.

This is a great goal for core, and is close, but it is not in shape to be shipped for 4.7 and there is not enough time left in the development cycle to alter and polish sufficiently. There are bugs, but more than that, there are more fundamental questions around the use of existing UI, general UX, and how findable themes are (not) on the .org side.

see #37661.

Built from https://develop.svn.wordpress.org/trunk@39140


git-svn-id: http://core.svn.wordpress.org/trunk@39080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Helen Hou-Sandí
2016-11-04 17:18:26 +00:00
parent fa5b5199e8
commit 1281a28382
20 changed files with 487 additions and 2354 deletions

View File

@@ -62,22 +62,18 @@ class WP_Customize_Theme_Control extends WP_Customize_Control {
* @access public
*/
public function content_template() {
/* translators: %s: theme name */
$details_label = sprintf( __( 'Details for theme: %s' ), '{{ data.theme.name }}' );
/* translators: %s: theme name */
$customize_label = sprintf( __( 'Customize theme: %s' ), '{{ data.theme.name }}' );
/* translators: %s: theme name */
$preview_label = sprintf( __( 'Live preview theme: %s' ), '{{ data.theme.name }}' );
/* translators: %s: theme name */
$install_label = sprintf( __( 'Install and preview theme: %s' ), '{{ data.theme.name }}' );
$current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
$active_url = esc_url( remove_query_arg( 'customize_theme', $current_url ) );
$preview_url = esc_url( add_query_arg( 'customize_theme', '__THEME__', $current_url ) ); // Token because esc_url() strips curly braces.
$preview_url = str_replace( '__THEME__', '{{ data.theme.id }}', $preview_url );
?>
<# if ( data.theme.active ) { #>
<div class="theme active" tabindex="0" aria-describedby="{{ data.section }}-{{ data.theme.id }}-action {{ data.theme.id }}-name">
<# if ( data.theme.isActiveTheme ) { #>
<div class="theme active" tabindex="0" data-preview-url="<?php echo esc_attr( $active_url ); ?>" aria-describedby="{{ data.theme.id }}-action {{ data.theme.id }}-name">
<# } else { #>
<div class="theme" tabindex="0" aria-describedby="{{ data.section }}-{{ data.theme.id }}-action {{ data.theme.id }}-name">
<div class="theme" tabindex="0" data-preview-url="<?php echo esc_attr( $preview_url ); ?>" aria-describedby="{{ data.theme.id }}-action {{ data.theme.id }}-name">
<# } #>
<# if ( data.theme.screenshot && data.theme.screenshot[0] ) { #>
<# if ( data.theme.screenshot[0] ) { #>
<div class="theme-screenshot">
<img data-src="{{ data.theme.screenshot[0] }}" alt="" />
</div>
@@ -85,34 +81,25 @@ class WP_Customize_Theme_Control extends WP_Customize_Control {
<div class="theme-screenshot blank"></div>
<# } #>
<span class="more-details theme-details" id="{{ data.section }}-{{ data.theme.id }}-action" aria-label="<?php echo esc_attr( $details_label ); ?>"><?php _e( 'Theme Details' ); ?></span>
<# if ( 'installed' === data.theme.type && data.theme.hasUpdate ) { #>
<div class="update-message notice inline notice-warning notice-alt" data-slug="{{ data.theme.id }}"><p><?php printf( __( 'New version available. %s' ), '<button class="button-link update-theme" type="button">' . __( 'Update now' ) . '</button>' ); ?></p></div>
<# if ( data.theme.isActiveTheme ) { #>
<span class="more-details" id="{{ data.theme.id }}-action"><?php _e( 'Customize' ); ?></span>
<# } else { #>
<span class="more-details" id="{{ data.theme.id }}-action"><?php _e( 'Live Preview' ); ?></span>
<# } #>
<# if ( data.theme.active ) { #>
<h3 class="theme-name" id="{{ data.section }}-{{ data.theme.id }}-name">
<div class="theme-author"><?php printf( __( 'By %s' ), '{{ data.theme.author }}' ); ?></div>
<# if ( data.theme.isActiveTheme ) { #>
<h3 class="theme-name" id="{{ data.theme.id }}-name">
<?php
/* translators: %s: theme name */
printf( __( '<span>Current:</span> %s' ), '{{ data.theme.name }}' );
printf( __( '<span>Active:</span> %s' ), '{{{ data.theme.name }}}' );
?>
</h3>
<div class="theme-actions">
<button type="button" class="button button-primary customize-theme" aria-label="<?php echo esc_attr( $customize_label ); ?>"><?php _e( 'Customize' ); ?></button>
</div>
<div class="notice notice-success notice-alt"><p><?php _e( 'Installed' ); ?></p></div>
<# } else if ( 'installed' === data.theme.type ) { #>
<h3 class="theme-name" id="{{ data.section }}-{{ data.theme.id }}-name">{{ data.theme.name }}</h3>
<div class="theme-actions">
<button type="button" class="button button-primary preview-theme" aria-label="<?php echo esc_attr( $preview_label ); ?>" data-slug="{{ data.theme.id }}"><?php _e( 'Live Preview' ); ?></span>
</div>
<div class="notice notice-success notice-alt"><p><?php _e( 'Installed' ); ?></p></div>
<# } else { #>
<h3 class="theme-name" id="{{ data.section }}-{{ data.theme.id }}-name">{{ data.theme.name }}</h3>
<h3 class="theme-name" id="{{ data.theme.id }}-name">{{{ data.theme.name }}}</h3>
<div class="theme-actions">
<button type="button" class="button button-primary theme-install preview" aria-label="<?php echo esc_attr( $install_label ); ?>" data-slug="{{ data.theme.id }}" data-name="{{ data.theme.name }}"><?php _e( 'Install & Preview' ); ?></button>
<button type="button" class="button theme-details"><?php _e( 'Theme Details' ); ?></button>
</div>
<# } #>
</div>