Ticket #20403: 20403.diff

File 20403.diff, 2.9 KB (added by aaroncampbell, 13 months ago)
  • wp-admin/js/theme.dev.js

     
    3434                event.preventDefault(); 
    3535        }); 
    3636 
    37         $('#availablethemes').on( 'click', '.installable-theme', function( event ) { 
     37        $('#availablethemes').on( 'click', '.customize-installable-theme', function( event ) { 
    3838                var src; 
    3939 
    4040                info.html( $(this).find('.install-theme-info').html() ); 
  • wp-admin/includes/class-wp-theme-install-list-table.php

     
    193193                ) ); 
    194194 
    195195                ?> 
    196                 <a class="screenshot" href="<?php echo esc_url( $preview_url ); ?>" title="<?php echo esc_attr( $preview_title ); ?>"> 
     196                <a class="screenshot customize-installable-theme" href="<?php echo esc_url( $preview_url ); ?>" title="<?php echo esc_attr( $preview_title ); ?>"> 
    197197                        <img src='<?php echo esc_url( $theme->screenshot_url ); ?>' width='150' /> 
    198198                </a> 
    199199 
    200200                <h3><?php echo $name; ?></h3> 
    201201                <div class="theme-author"><?php printf( __( 'By %s' ), $author ); ?></div> 
     202                <?php 
     203                        $action_links = array(); 
    202204 
     205                        if ( current_user_can( 'install_themes' ) || current_user_can( 'update_themes' ) ) { 
     206                                $install_url = add_query_arg( array( 
     207                                        'action' => 'install-theme', 
     208                                        'theme'  => $theme->slug, 
     209                                ), self_admin_url( 'update.php' ) ); 
     210                                $action_links[] = '<a class="install-now" href="' . wp_nonce_url( $install_url, 'install-theme_' . $theme->slug ) . '" title="' . esc_attr( sprintf( __( 'Install %s' ), $name ) ) . '">' . __( 'Install Now' ) . '</a>'; 
     211                        } 
     212 
     213                        $action_links[] = '<a class="preview-now customize-installable-theme" href="#" title="' . esc_attr( sprintf( __( 'Preview %s' ), $name ) ) . '">' . __( 'Preview' ) . '</a>'; 
     214 
     215                        $action_links = apply_filters( 'theme_install_action_links', $action_links, $plugin ); 
     216                ?> 
     217                <div class="action-links"> 
     218                        <ul> 
     219                                <?php foreach ( $action_links as $action ): ?> 
     220                                        <li><?php echo $action; ?></li> 
     221                                <?php endforeach; ?> 
     222                                <li class="hide-if-no-js"><a href="#" class="theme-detail" tabindex='4'><?php _e('Details') ?></a></li> 
     223                        </ul> 
     224                        <?php echo $delete_action; ?> 
     225 
     226                        <?php theme_update_available( $theme ); ?> 
     227                </div> 
     228 
    203229                <?php 
     230                $this->theme_details( $theme ); 
    204231                $this->install_theme_info( $theme ); 
    205232        } 
    206233 
     
    292319                <?php 
    293320        } 
    294321 
     322        /* 
     323         * Prints the details for a theme 
     324         * 
     325         * @param object $theme - A WordPress.org Theme API object. 
     326         */ 
     327        function theme_details( $theme ) { 
     328                ?> 
     329                <div class="themedetaildiv hide-if-js"> 
     330                        <p><strong><?php _e('Version: '); ?></strong><?php echo esc_html( $theme->version ); ?></p> 
     331                        <p><?php echo esc_html( $theme->description ); ?></p> 
     332                </div> 
     333                <?php 
     334        } 
     335 
    295336        /** 
    296337         * Send required variables to JavaScript land 
    297338         *