Skip to content

Commit f7e5811

Browse files
committed
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. git-svn-id: https://develop.svn.wordpress.org/trunk@39140 602fd350-edb4-49c9-b593-d223f7449a82
1 parent f8a5c7b commit f7e5811

12 files changed

Lines changed: 393 additions & 1816 deletions

src/wp-admin/css/customize-controls.css

Lines changed: 70 additions & 513 deletions
Large diffs are not rendered by default.

src/wp-admin/css/themes.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ body.folded .theme-browser ~ .theme-overlay .theme-wrap {
570570
float: left;
571571
margin: 0 30px 0 0;
572572
width: 55%;
573-
max-width: 1200px; /* Recommended theme screenshot width, set here to avoid stretching */
573+
max-width: 880px;
574574
text-align: center;
575575
}
576576

src/wp-admin/customize.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@
109109
?><title><?php echo $admin_title; ?></title>
110110

111111
<script type="text/javascript">
112-
var ajaxurl = <?php echo wp_json_encode( admin_url( 'admin-ajax.php', 'relative' ) ); ?>,
113-
pagenow = 'customize';
112+
var ajaxurl = <?php echo wp_json_encode( admin_url( 'admin-ajax.php', 'relative' ) ); ?>;
114113
</script>
115114

116115
<?php

src/wp-admin/includes/theme.php

Lines changed: 16 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,8 @@ function wp_prepare_themes_for_js( $themes = null ) {
609609
* @since 4.2.0
610610
*/
611611
function customize_themes_print_templates() {
612+
$preview_url = esc_url( add_query_arg( 'theme', '__THEME__' ) ); // Token because esc_url() strips curly braces.
613+
$preview_url = str_replace( '__THEME__', '{{ data.id }}', $preview_url );
612614
?>
613615
<script type="text/html" id="tmpl-customize-themes-details-view">
614616
<div class="theme-backdrop"></div>
@@ -620,7 +622,7 @@ function customize_themes_print_templates() {
620622
</div>
621623
<div class="theme-about wp-clearfix">
622624
<div class="theme-screenshots">
623-
<# if ( data.screenshot && data.screenshot[0] ) { #>
625+
<# if ( data.screenshot[0] ) { #>
624626
<div class="screenshot"><img src="{{ data.screenshot[0] }}" alt="" /></div>
625627
<# } else { #>
626628
<div class="screenshot blank"></div>
@@ -633,47 +635,29 @@ function customize_themes_print_templates() {
633635
<# } #>
634636
<h2 class="theme-name">{{{ data.name }}}<span class="theme-version"><?php printf( __( 'Version: %s' ), '{{ data.version }}' ); ?></span></h2>
635637
<h3 class="theme-author"><?php printf( __( 'By %s' ), '{{{ data.authorAndUri }}}' ); ?></h3>
636-
637-
<# if ( data.stars && 0 != data.num_ratings ) { #>
638-
<div class="theme-rating">
639-
{{{ data.stars }}}
640-
<span class="num-ratings"><?php echo sprintf( __( '(%s ratings)' ), '{{ data.num_ratings }}' ); ?></span>
641-
</div>
642-
<# } #>
643-
644-
<# if ( data.hasUpdate ) { #>
645-
<div class="notice notice-warning notice-alt notice-large" data-slug="{{ data.id }}">
646-
<h3 class="notice-title"><?php _e( 'Update Available' ); ?></h3>
647-
{{{ data.update }}}
648-
</div>
649-
<# } #>
650-
651638
<p class="theme-description">{{{ data.description }}}</p>
652639

653640
<# if ( data.parent ) { #>
654641
<p class="parent-theme"><?php printf( __( 'This is a child theme of %s.' ), '<strong>{{{ data.parent }}}</strong>' ); ?></p>
655642
<# } #>
643+
656644
<# if ( data.tags ) { #>
657-
<p class="theme-tags"><span><?php _e( 'Tags:' ); ?></span> {{{ data.tags }}}</p>
645+
<p class="theme-tags"><span><?php _e( 'Tags:' ); ?></span> {{ data.tags }}</p>
658646
<# } #>
659647
</div>
660648
</div>
661649

662-
<div class="theme-actions">
663-
<# if ( data.active ) { #>
664-
<button type="button" class="button button-primary customize-theme"><?php _e( 'Customize' ); ?></a>
665-
<# } else if ( 'installed' === data.type ) { #>
666-
<?php if ( current_user_can( 'delete_themes' ) ) { ?>
667-
<# if ( data.actions && data.actions['delete'] ) { #>
668-
<a href="{{{ data.actions['delete'] }}}" data-slug="{{ data.id }}" class="button button-secondary delete-theme"><?php _e( 'Delete' ); ?></a>
669-
<# } #>
670-
<?php } ?>
671-
<button type="button" class="button button-primary preview-theme" data-slug="{{ data.id }}"><?php _e( 'Live Preview' ); ?></span>
672-
<# } else { #>
673-
<button type="button" class="button theme-install" data-slug="{{ data.id }}"><?php _e( 'Install' ); ?></button>
674-
<button type="button" class="button button-primary theme-install preview" data-slug="{{ data.id }}"><?php _e( 'Install & Preview' ); ?></button>
675-
<# } #>
676-
</div>
650+
<# if ( ! data.active ) { #>
651+
<div class="theme-actions">
652+
<div class="inactive-theme">
653+
<?php
654+
/* translators: %s: Theme name */
655+
$aria_label = sprintf( __( 'Preview %s' ), '{{ data.name }}' );
656+
?>
657+
<a href="<?php echo $preview_url; ?>" target="_top" class="button button-primary" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Live Preview' ); ?></a>
658+
</div>
659+
</div>
660+
<# } #>
677661
</div>
678662
</script>
679663
<?php

src/wp-admin/includes/update-core.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,7 @@
710710
'wp-includes/class-feed.php',
711711
'wp-includes/locale.php',
712712
'wp-includes/session.php',
713+
'wp-includes/customize/class-wp-customize-themes-panel.php', // Removed in beta; when the feature comes back remember to remove it from this array. See #37661.
713714
);
714715

715716
/**

0 commit comments

Comments
 (0)