Changeset 39140 for trunk/src/wp-admin/includes/theme.php
- Timestamp:
- 11/04/2016 03:53:01 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/theme.php
r38951 r39140 610 610 */ 611 611 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 ); 612 614 ?> 613 615 <script type="text/html" id="tmpl-customize-themes-details-view"> … … 621 623 <div class="theme-about wp-clearfix"> 622 624 <div class="theme-screenshots"> 623 <# if ( data.screenshot && data.screenshot[0] ) { #>625 <# if ( data.screenshot[0] ) { #> 624 626 <div class="screenshot"><img src="{{ data.screenshot[0] }}" alt="" /></div> 625 627 <# } else { #> … … 634 636 <h2 class="theme-name">{{{ data.name }}}<span class="theme-version"><?php printf( __( 'Version: %s' ), '{{ data.version }}' ); ?></span></h2> 635 637 <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 651 638 <p class="theme-description">{{{ data.description }}}</p> 652 639 … … 654 641 <p class="parent-theme"><?php printf( __( 'This is a child theme of %s.' ), '<strong>{{{ data.parent }}}</strong>' ); ?></p> 655 642 <# } #> 643 656 644 <# 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> 658 646 <# } #> 659 647 </div> 660 648 </div> 661 649 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 <# } #> 677 661 </div> 678 662 </script>
Note: See TracChangeset
for help on using the changeset viewer.