Make WordPress Core


Ignore:
Timestamp:
11/04/2016 03:53:01 PM (8 years ago)
Author:
helen
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/theme.php

    r38951 r39140  
    610610 */
    611611function 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">
     
    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 { #>
     
    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
     
    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>
Note: See TracChangeset for help on using the changeset viewer.