Changeset 38813 for trunk/src/wp-admin/includes/theme.php
- Timestamp:
- 10/19/2016 03:19:13 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/theme.php
r38788 r38813 608 608 */ 609 609 function customize_themes_print_templates() { 610 $preview_url = esc_url( add_query_arg( 'theme', '__THEME__' ) ); // Token because esc_url() strips curly braces.611 $preview_url = str_replace( '__THEME__', '{{ data.id }}', $preview_url );612 610 ?> 613 611 <script type="text/html" id="tmpl-customize-themes-details-view"> … … 621 619 <div class="theme-about wp-clearfix"> 622 620 <div class="theme-screenshots"> 623 <# if ( data.screenshot [0] ) { #>621 <# if ( data.screenshot && data.screenshot[0] ) { #> 624 622 <div class="screenshot"><img src="{{ data.screenshot[0] }}" alt="" /></div> 625 623 <# } else { #> … … 634 632 <h2 class="theme-name">{{{ data.name }}}<span class="theme-version"><?php printf( __( 'Version: %s' ), '{{ data.version }}' ); ?></span></h2> 635 633 <h3 class="theme-author"><?php printf( __( 'By %s' ), '{{{ data.authorAndUri }}}' ); ?></h3> 634 635 <# if ( data.stars && 0 != data.num_ratings ) { #> 636 <div class="theme-rating"> 637 {{{ data.stars }}} 638 <span class="num-ratings"><?php echo sprintf( __( '(%s ratings)' ), '{{ data.num_ratings }}' ); ?></span> 639 </div> 640 <# } #> 641 642 <# if ( data.hasUpdate ) { #> 643 <div class="notice notice-warning notice-alt notice-large" data-slug="{{ data.id }}"> 644 <h3 class="notice-title"><?php _e( 'Update Available' ); ?></h3> 645 {{{ data.update }}} 646 </div> 647 <# } #> 648 636 649 <p class="theme-description">{{{ data.description }}}</p> 637 650 … … 639 652 <p class="parent-theme"><?php printf( __( 'This is a child theme of %s.' ), '<strong>{{{ data.parent }}}</strong>' ); ?></p> 640 653 <# } #> 641 642 654 <# if ( data.tags ) { #> 643 <p class="theme-tags"><span><?php _e( 'Tags:' ); ?></span> {{ data.tags}}</p>655 <p class="theme-tags"><span><?php _e( 'Tags:' ); ?></span> {{{ data.tags }}}</p> 644 656 <# } #> 645 657 </div> 646 658 </div> 647 659 648 <# if ( ! data.active ) { #> 649 <div class="theme-actions"> 650 <div class="inactive-theme"> 651 <?php 652 /* translators: %s: Theme name */ 653 $aria_label = sprintf( __( 'Preview %s' ), '{{ data.name }}' ); 654 ?> 655 <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> 656 </div> 657 </div> 658 <# } #> 660 <div class="theme-actions"> 661 <# if ( data.active ) { #> 662 <button type="button" class="button button-primary customize-theme"><?php _e( 'Customize' ); ?></a> 663 <# } else if ( 'installed' === data.type ) { #> 664 <?php if ( current_user_can( 'delete_themes' ) ) { ?> 665 <# if ( data.actions && data.actions['delete'] ) { #> 666 <a href="{{{ data.actions['delete'] }}}" data-slug="{{ data.id }}" class="button button-secondary delete-theme"><?php _e( 'Delete' ); ?></a> 667 <# } #> 668 <?php } ?> 669 <button type="button" class="button button-primary preview-theme" data-slug="{{ data.id }}"><?php _e( 'Live Preview' ); ?></span> 670 <# } else { #> 671 <button type="button" class="button theme-install" data-slug="{{ data.id }}"><?php _e( 'Install' ); ?></button> 672 <button type="button" class="button button-primary theme-install preview" data-slug="{{ data.id }}"><?php _e( 'Install & Preview' ); ?></button> 673 <# } #> 674 </div> 659 675 </div> 660 676 </script>
Note: See TracChangeset
for help on using the changeset viewer.