Make WordPress Core

Ticket #28749: 28749.1.diff

File 28749.1.diff, 22.3 KB (added by michalzuber, 9 years ago)

Only install_themes_upload() is used in wp-admin/theme-install.php

  • src/wp-admin/includes/ajax-actions.php

     
    25772577
    25782578        $old_filter = isset( $args['browse'] ) ? $args['browse'] : 'search';
    25792579
    2580         /** This filter is documented in wp-admin/includes/class-wp-theme-install-list-table.php */
     2580        /**
     2581         * Filter API request arguments for each Install Themes screen tab.
     2582         *
     2583         * The dynamic portion of the hook name, $tab, refers to the theme install
     2584         * tabs. Default tabs are 'dashboard', 'search', 'upload', 'featured',
     2585         * 'new', and 'updated'.
     2586         *
     2587         * @since 3.7.0
     2588         *
     2589         * @param array $args An array of themes API arguments.
     2590         */
    25812591        $args = apply_filters( 'install_themes_table_api_args_' . $old_filter, $args );
    25822592
    25832593        $api = themes_api( 'query_themes', $args );
  • src/wp-admin/includes/class-wp-theme-install-list-table.php

     
    1 <?php
    2 /**
    3  * Theme Installer List Table class.
    4  *
    5  * @package WordPress
    6  * @subpackage List_Table
    7  * @since 3.1.0
    8  * @access private
    9  */
    10 class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
    11 
    12         public $features = array();
    13 
    14         public function ajax_user_can() {
    15                 return current_user_can( 'install_themes' );
    16         }
    17 
    18         public function prepare_items() {
    19                 include( ABSPATH . 'wp-admin/includes/theme-install.php' );
    20 
    21                 global $tabs, $tab, $paged, $type, $theme_field_defaults;
    22                 wp_reset_vars( array( 'tab' ) );
    23 
    24                 $search_terms = array();
    25                 $search_string = '';
    26                 if ( ! empty( $_REQUEST['s'] ) ){
    27                         $search_string = strtolower( wp_unslash( $_REQUEST['s'] ) );
    28                         $search_terms = array_unique( array_filter( array_map( 'trim', explode( ',', $search_string ) ) ) );
    29                 }
    30 
    31                 if ( ! empty( $_REQUEST['features'] ) )
    32                         $this->features = $_REQUEST['features'];
    33 
    34                 $paged = $this->get_pagenum();
    35 
    36                 $per_page = 36;
    37 
    38                 // These are the tabs which are shown on the page,
    39                 $tabs = array();
    40                 $tabs['dashboard'] = __( 'Search' );
    41                 if ( 'search' == $tab )
    42                         $tabs['search'] = __( 'Search Results' );
    43                 $tabs['upload'] = __( 'Upload' );
    44                 $tabs['featured'] = _x( 'Featured', 'themes' );
    45                 //$tabs['popular']  = _x( 'Popular', 'themes' );
    46                 $tabs['new']      = _x( 'Latest', 'themes' );
    47                 $tabs['updated']  = _x( 'Recently Updated', 'themes' );
    48 
    49                 $nonmenu_tabs = array( 'theme-information' ); // Valid actions to perform which do not have a Menu item.
    50 
    51                 /** This filter is documented in wp-admin/theme-install.php */
    52                 $tabs = apply_filters( 'install_themes_tabs', $tabs );
    53 
    54                 /**
    55                  * Filter tabs not associated with a menu item on the Install Themes screen.
    56                  *
    57                  * @since 2.8.0
    58                  *
    59                  * @param array $nonmenu_tabs The tabs that don't have a menu item on
    60                  *                            the Install Themes screen.
    61                  */
    62                 $nonmenu_tabs = apply_filters( 'install_themes_nonmenu_tabs', $nonmenu_tabs );
    63 
    64                 // If a non-valid menu tab has been selected, And it's not a non-menu action.
    65                 if ( empty( $tab ) || ( ! isset( $tabs[ $tab ] ) && ! in_array( $tab, (array) $nonmenu_tabs ) ) )
    66                         $tab = key( $tabs );
    67 
    68                 $args = array( 'page' => $paged, 'per_page' => $per_page, 'fields' => $theme_field_defaults );
    69 
    70                 switch ( $tab ) {
    71                         case 'search':
    72                                 $type = isset( $_REQUEST['type'] ) ? wp_unslash( $_REQUEST['type'] ) : 'term';
    73                                 switch ( $type ) {
    74                                         case 'tag':
    75                                                 $args['tag'] = array_map( 'sanitize_key', $search_terms );
    76                                                 break;
    77                                         case 'term':
    78                                                 $args['search'] = $search_string;
    79                                                 break;
    80                                         case 'author':
    81                                                 $args['author'] = $search_string;
    82                                                 break;
    83                                 }
    84 
    85                                 if ( ! empty( $this->features ) ) {
    86                                         $args['tag'] = $this->features;
    87                                         $_REQUEST['s'] = implode( ',', $this->features );
    88                                         $_REQUEST['type'] = 'tag';
    89                                 }
    90 
    91                                 add_action( 'install_themes_table_header', 'install_theme_search_form', 10, 0 );
    92                                 break;
    93 
    94                         case 'featured':
    95                         //case 'popular':
    96                         case 'new':
    97                         case 'updated':
    98                                 $args['browse'] = $tab;
    99                                 break;
    100 
    101                         default:
    102                                 $args = false;
    103                                 break;
    104                 }
    105 
    106                 /**
    107                  * Filter API request arguments for each Install Themes screen tab.
    108                  *
    109                  * The dynamic portion of the hook name, $tab, refers to the theme install
    110                  * tabs. Default tabs are 'dashboard', 'search', 'upload', 'featured',
    111                  * 'new', and 'updated'.
    112                  *
    113                  * @since 3.7.0
    114                  *
    115                  * @param array $args An array of themes API arguments.
    116                  */
    117                 $args = apply_filters( 'install_themes_table_api_args_' . $tab, $args );
    118 
    119                 if ( ! $args )
    120                         return;
    121 
    122                 $api = themes_api( 'query_themes', $args );
    123 
    124                 if ( is_wp_error( $api ) )
    125                         wp_die( $api->get_error_message() . '</p> <p><a href="#" onclick="document.location.reload(); return false;">' . __( 'Try again' ) . '</a>' );
    126 
    127                 $this->items = $api->themes;
    128 
    129                 $this->set_pagination_args( array(
    130                         'total_items' => $api->info['results'],
    131                         'per_page' => $args['per_page'],
    132                         'infinite_scroll' => true,
    133                 ) );
    134         }
    135 
    136         public function no_items() {
    137                 _e( 'No themes match your request.' );
    138         }
    139 
    140         protected function get_views() {
    141                 global $tabs, $tab;
    142 
    143                 $display_tabs = array();
    144                 foreach ( (array) $tabs as $action => $text ) {
    145                         $class = ( $action == $tab ) ? ' class="current"' : '';
    146                         $href = self_admin_url('theme-install.php?tab=' . $action);
    147                         $display_tabs['theme-install-'.$action] = "<a href='$href'$class>$text</a>";
    148                 }
    149 
    150                 return $display_tabs;
    151         }
    152 
    153         public function display() {
    154                 wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' );
    155 ?>
    156                 <div class="tablenav top themes">
    157                         <div class="alignleft actions">
    158                                 <?php
    159                                 /**
    160                                  * Fires in the Install Themes list table header.
    161                                  *
    162                                  * @since 2.8.0
    163                                  */
    164                                 do_action( 'install_themes_table_header' );
    165                                 ?>
    166                         </div>
    167                         <?php $this->pagination( 'top' ); ?>
    168                         <br class="clear" />
    169                 </div>
    170 
    171                 <div id="availablethemes">
    172                         <?php $this->display_rows_or_placeholder(); ?>
    173                 </div>
    174 
    175                 <?php
    176                 parent::tablenav( 'bottom' );
    177         }
    178 
    179         public function display_rows() {
    180                 $themes = $this->items;
    181                 foreach ( $themes as $theme ) {
    182                                 ?>
    183                                 <div class="available-theme installable-theme"><?php
    184                                         $this->single_row( $theme );
    185                                 ?></div>
    186                 <?php } // end foreach $theme_names
    187 
    188                 $this->theme_installer();
    189         }
    190 
    191         /**
    192          * Prints a theme from the WordPress.org API.
    193          *
    194          * @param object $theme An object that contains theme data returned by the WordPress.org API.
    195          *
    196          * Example theme data:
    197          *   object(stdClass)[59]
    198          *     public 'name' => string 'Magazine Basic'
    199          *     public 'slug' => string 'magazine-basic'
    200          *     public 'version' => string '1.1'
    201          *     public 'author' => string 'tinkerpriest'
    202          *     public 'preview_url' => string 'http://wp-themes.com/?magazine-basic'
    203          *     public 'screenshot_url' => string 'http://wp-themes.com/wp-content/themes/magazine-basic/screenshot.png'
    204          *     public 'rating' => float 80
    205          *     public 'num_ratings' => int 1
    206          *     public 'homepage' => string 'http://wordpress.org/themes/magazine-basic'
    207          *     public 'description' => string 'A basic magazine style layout with a fully customizable layout through a backend interface. Designed by <a href="http://bavotasan.com">c.bavota</a> of <a href="http://tinkerpriestmedia.com">Tinker Priest Media</a>.'
    208          *     public 'download_link' => string 'http://wordpress.org/themes/download/magazine-basic.1.1.zip'
    209          */
    210         public function single_row( $theme ) {
    211                 global $themes_allowedtags;
    212 
    213                 if ( empty( $theme ) )
    214                         return;
    215 
    216                 $name   = wp_kses( $theme->name,   $themes_allowedtags );
    217                 $author = wp_kses( $theme->author, $themes_allowedtags );
    218 
    219                 $preview_title = sprintf( __('Preview &#8220;%s&#8221;'), $name );
    220                 $preview_url   = add_query_arg( array(
    221                         'tab'   => 'theme-information',
    222                         'theme' => $theme->slug,
    223                 ), self_admin_url( 'theme-install.php' ) );
    224 
    225                 $actions = array();
    226 
    227                 $install_url = add_query_arg( array(
    228                         'action' => 'install-theme',
    229                         'theme'  => $theme->slug,
    230                 ), self_admin_url( 'update.php' ) );
    231 
    232                 $update_url = add_query_arg( array(
    233                         'action' => 'upgrade-theme',
    234                         'theme'  => $theme->slug,
    235                 ), self_admin_url( 'update.php' ) );
    236 
    237                 $status = $this->_get_theme_status( $theme );
    238 
    239                 switch ( $status ) {
    240                         case 'update_available':
    241                                 $actions[] = '<a class="install-now" href="' . esc_url( wp_nonce_url( $update_url, 'upgrade-theme_' . $theme->slug ) ) . '" title="' . esc_attr( sprintf( __( 'Update to version %s' ), $theme->version ) ) . '">' . __( 'Update' ) . '</a>';
    242                                 break;
    243                         case 'newer_installed':
    244                         case 'latest_installed':
    245                                 $actions[] = '<span class="install-now" title="' . esc_attr__( 'This theme is already installed and is up to date' ) . '">' . _x( 'Installed', 'theme' ) . '</span>';
    246                                 break;
    247                         case 'install':
    248                         default:
    249                                 $actions[] = '<a class="install-now" href="' . esc_url( wp_nonce_url( $install_url, 'install-theme_' . $theme->slug ) ) . '" title="' . esc_attr( sprintf( __( 'Install %s' ), $name ) ) . '">' . __( 'Install Now' ) . '</a>';
    250                                 break;
    251                 }
    252 
    253                 $actions[] = '<a class="install-theme-preview" href="' . esc_url( $preview_url ) . '" title="' . esc_attr( sprintf( __( 'Preview %s' ), $name ) ) . '">' . __( 'Preview' ) . '</a>';
    254 
    255                 /**
    256                  * Filter the install action links for a theme in the Install Themes list table.
    257                  *
    258                  * @since 3.4.0
    259                  *
    260                  * @param array    $actions An array of theme action hyperlinks. Defaults are
    261                  *                          links to Install Now, Preview, and Details.
    262                  * @param WP_Theme $theme   Theme object.
    263                  */
    264                 $actions = apply_filters( 'theme_install_actions', $actions, $theme );
    265 
    266                 ?>
    267                 <a class="screenshot install-theme-preview" href="<?php echo esc_url( $preview_url ); ?>" title="<?php echo esc_attr( $preview_title ); ?>">
    268                         <img src="<?php echo esc_url( $theme->screenshot_url ); ?>" width="150" />
    269                 </a>
    270 
    271                 <h3><?php echo $name; ?></h3>
    272                 <div class="theme-author"><?php printf( __( 'By %s' ), $author ); ?></div>
    273 
    274                 <div class="action-links">
    275                         <ul>
    276                                 <?php foreach ( $actions as $action ): ?>
    277                                         <li><?php echo $action; ?></li>
    278                                 <?php endforeach; ?>
    279                                 <li class="hide-if-no-js"><a href="#" class="theme-detail"><?php _e('Details') ?></a></li>
    280                         </ul>
    281                 </div>
    282 
    283                 <?php
    284                 $this->install_theme_info( $theme );
    285         }
    286 
    287         /**
    288          * Prints the wrapper for the theme installer.
    289          */
    290         public function theme_installer() {
    291                 ?>
    292                 <div id="theme-installer" class="wp-full-overlay expanded">
    293                         <div class="wp-full-overlay-sidebar">
    294                                 <div class="wp-full-overlay-header">
    295                                         <a href="#" class="close-full-overlay button-secondary"><?php _e( 'Close' ); ?></a>
    296                                         <span class="theme-install"></span>
    297                                 </div>
    298                                 <div class="wp-full-overlay-sidebar-content">
    299                                         <div class="install-theme-info"></div>
    300                                 </div>
    301                                 <div class="wp-full-overlay-footer">
    302                                         <a href="#" class="collapse-sidebar" title="<?php esc_attr_e('Collapse Sidebar'); ?>">
    303                                                 <span class="collapse-sidebar-label"><?php _e('Collapse'); ?></span>
    304                                                 <span class="collapse-sidebar-arrow"></span>
    305                                         </a>
    306                                 </div>
    307                         </div>
    308                         <div class="wp-full-overlay-main"></div>
    309                 </div>
    310                 <?php
    311         }
    312 
    313         /**
    314          * Prints the wrapper for the theme installer with a provided theme's data.
    315          * Used to make the theme installer work for no-js.
    316          *
    317          * @param object $theme - A WordPress.org Theme API object.
    318          */
    319         public function theme_installer_single( $theme ) {
    320                 ?>
    321                 <div id="theme-installer" class="wp-full-overlay single-theme">
    322                         <div class="wp-full-overlay-sidebar">
    323                                 <?php $this->install_theme_info( $theme ); ?>
    324                         </div>
    325                         <div class="wp-full-overlay-main">
    326                                 <iframe src="<?php echo esc_url( $theme->preview_url ); ?>"></iframe>
    327                         </div>
    328                 </div>
    329                 <?php
    330         }
    331 
    332         /**
    333          * Prints the info for a theme (to be used in the theme installer modal).
    334          *
    335          * @param object $theme - A WordPress.org Theme API object.
    336          */
    337         public function install_theme_info( $theme ) {
    338                 global $themes_allowedtags;
    339 
    340                 if ( empty( $theme ) )
    341                         return;
    342 
    343                 $name   = wp_kses( $theme->name,   $themes_allowedtags );
    344                 $author = wp_kses( $theme->author, $themes_allowedtags );
    345 
    346                 $num_ratings = sprintf( _n( '(based on %s rating)', '(based on %s ratings)', $theme->num_ratings ), number_format_i18n( $theme->num_ratings ) );
    347 
    348                 $install_url = add_query_arg( array(
    349                         'action' => 'install-theme',
    350                         'theme'  => $theme->slug,
    351                 ), self_admin_url( 'update.php' ) );
    352 
    353                 $update_url = add_query_arg( array(
    354                         'action' => 'upgrade-theme',
    355                         'theme'  => $theme->slug,
    356                 ), self_admin_url( 'update.php' ) );
    357 
    358                 $status = $this->_get_theme_status( $theme );
    359 
    360                 ?>
    361                 <div class="install-theme-info"><?php
    362                         switch ( $status ) {
    363                                 case 'update_available':
    364                                         echo '<a class="theme-install button-primary" href="' . esc_url( wp_nonce_url( $update_url, 'upgrade-theme_' . $theme->slug ) ) . '" title="' . esc_attr( sprintf( __( 'Update to version %s' ), $theme->version ) ) . '">' . __( 'Update' ) . '</a>';
    365                                         break;
    366                                 case 'newer_installed':
    367                                 case 'latest_installed':
    368                                         echo '<span class="theme-install" title="' . esc_attr__( 'This theme is already installed and is up to date' ) . '">' . _x( 'Installed', 'theme' ) . '</span>';
    369                                         break;
    370                                 case 'install':
    371                                 default:
    372                                         echo '<a class="theme-install button-primary" href="' . esc_url( wp_nonce_url( $install_url, 'install-theme_' . $theme->slug ) ) . '">' . __( 'Install' ) . '</a>';
    373                                         break;
    374                         } ?>
    375                         <h3 class="theme-name"><?php echo $name; ?></h3>
    376                         <span class="theme-by"><?php printf( __( 'By %s' ), $author ); ?></span>
    377                         <?php if ( isset( $theme->screenshot_url ) ): ?>
    378                                 <img class="theme-screenshot" src="<?php echo esc_url( $theme->screenshot_url ); ?>" />
    379                         <?php endif; ?>
    380                         <div class="theme-details">
    381                                 <?php wp_star_rating( array( 'rating' => $theme->rating, 'type' => 'percent', 'number' => $theme->num_ratings ) ); ?>
    382                                 <div class="theme-version">
    383                                         <strong><?php _e('Version:') ?> </strong>
    384                                         <?php echo wp_kses( $theme->version, $themes_allowedtags ); ?>
    385                                 </div>
    386                                 <div class="theme-description">
    387                                         <?php echo wp_kses( $theme->description, $themes_allowedtags ); ?>
    388                                 </div>
    389                         </div>
    390                         <input class="theme-preview-url" type="hidden" value="<?php echo esc_url( $theme->preview_url ); ?>" />
    391                 </div>
    392                 <?php
    393         }
    394 
    395         /**
    396          * Send required variables to JavaScript land
    397          *
    398          * @since 3.4.0
    399          * @access public
    400          *
    401          * @uses $tab Global; current tab within Themes->Install screen
    402          * @uses $type Global; type of search.
    403          */
    404         public function _js_vars( $extra_args = array() ) {
    405                 global $tab, $type;
    406                 parent::_js_vars( compact( 'tab', 'type' ) );
    407         }
    408 
    409         /**
    410          * Check to see if the theme is already installed.
    411          *
    412          * @since 3.4.0
    413          * @access private
    414          *
    415          * @param object $theme - A WordPress.org Theme API object.
    416          * @return string Theme status.
    417          */
    418         private function _get_theme_status( $theme ) {
    419                 $status = 'install';
    420 
    421                 $installed_theme = wp_get_theme( $theme->slug );
    422                 if ( $installed_theme->exists() ) {
    423                         if ( version_compare( $installed_theme->get('Version'), $theme->version, '=' ) )
    424                                 $status = 'latest_installed';
    425                         elseif ( version_compare( $installed_theme->get('Version'), $theme->version, '>' ) )
    426                                 $status = 'newer_installed';
    427                         else
    428                                 $status = 'update_available';
    429                 }
    430 
    431                 return $status;
    432         }
    433 }
  • src/wp-admin/includes/list-table.php

     
    2929                'WP_Links_List_Table' => 'links',
    3030                'WP_Plugin_Install_List_Table' => 'plugin-install',
    3131                'WP_Themes_List_Table' => 'themes',
    32                 'WP_Theme_Install_List_Table' => array( 'themes', 'theme-install' ),
    3332                'WP_Plugins_List_Table' => 'plugins',
    3433                // Network Admin
    3534                'WP_MS_Sites_List_Table' => 'ms-sites',
  • src/wp-admin/includes/theme-install.php

     
    66 * @subpackage Administration
    77 */
    88
    9 $themes_allowedtags = array('a' => array('href' => array(), 'title' => array(), 'target' => array()),
    10         'abbr' => array('title' => array()), 'acronym' => array('title' => array()),
    11         'code' => array(), 'pre' => array(), 'em' => array(), 'strong' => array(),
    12         'div' => array(), 'p' => array(), 'ul' => array(), 'ol' => array(), 'li' => array(),
    13         'h1' => array(), 'h2' => array(), 'h3' => array(), 'h4' => array(), 'h5' => array(), 'h6' => array(),
    14         'img' => array('src' => array(), 'class' => array(), 'alt' => array())
    15 );
    16 
    17 $theme_field_defaults = array( 'description' => true, 'sections' => false, 'tested' => true, 'requires' => true,
    18         'rating' => true, 'downloaded' => true, 'downloadlink' => true, 'last_updated' => true, 'homepage' => true,
    19         'tags' => true, 'num_ratings' => true
    20 );
    21 
    229/**
    23  * Retrieve list of WordPress theme features (aka theme tags)
    24  *
    25  * @since 2.8.0
    26  *
    27  * @deprecated since 3.1.0 Use get_theme_feature_list() instead.
    28  *
    29  * @return array
    30  */
    31 function install_themes_feature_list() {
    32         _deprecated_function( __FUNCTION__, '3.1', 'get_theme_feature_list()' );
    33 
    34         if ( !$cache = get_transient( 'wporg_theme_feature_list' ) )
    35                 set_transient( 'wporg_theme_feature_list', array(), 3 * HOUR_IN_SECONDS );
    36 
    37         if ( $cache )
    38                 return $cache;
    39 
    40         $feature_list = themes_api( 'feature_list', array() );
    41         if ( is_wp_error( $feature_list ) )
    42                 return array();
    43 
    44         set_transient( 'wporg_theme_feature_list', $feature_list, 3 * HOUR_IN_SECONDS );
    45 
    46         return $feature_list;
    47 }
    48 
    49 /**
    50  * Display search form for searching themes.
    51  *
    52  * @since 2.8.0
    53  */
    54 function install_theme_search_form( $type_selector = true ) {
    55         $type = isset( $_REQUEST['type'] ) ? wp_unslash( $_REQUEST['type'] ) : 'term';
    56         $term = isset( $_REQUEST['s'] ) ? wp_unslash( $_REQUEST['s'] ) : '';
    57         if ( ! $type_selector )
    58                 echo '<p class="install-help">' . __( 'Search for themes by keyword.' ) . '</p>';
    59         ?>
    60 <form id="search-themes" method="get" action="">
    61         <input type="hidden" name="tab" value="search" />
    62         <?php if ( $type_selector ) : ?>
    63         <label class="screen-reader-text" for="typeselector"><?php _e('Type of search'); ?></label>
    64         <select name="type" id="typeselector">
    65         <option value="term" <?php selected('term', $type) ?>><?php _e('Keyword'); ?></option>
    66         <option value="author" <?php selected('author', $type) ?>><?php _e('Author'); ?></option>
    67         <option value="tag" <?php selected('tag', $type) ?>><?php _ex('Tag', 'Theme Installer'); ?></option>
    68         </select>
    69         <label class="screen-reader-text" for="s"><?php
    70         switch ( $type ) {
    71                 case 'term':
    72                         _e( 'Search by keyword' );
    73                         break;
    74                 case 'author':
    75                         _e( 'Search by author' );
    76                         break;
    77                 case 'tag':
    78                         _e( 'Search by tag' );
    79                         break;
    80         }
    81         ?></label>
    82         <?php else : ?>
    83         <label class="screen-reader-text" for="s"><?php _e('Search by keyword'); ?></label>
    84         <?php endif; ?>
    85         <input type="search" name="s" id="s" size="30" value="<?php echo esc_attr($term) ?>" autofocus="autofocus" />
    86         <?php submit_button( __( 'Search' ), 'button', 'search', false ); ?>
    87 </form>
    88 <?php
    89 }
    90 
    91 /**
    92  * Display tags filter for themes.
    93  *
    94  * @since 2.8.0
    95  */
    96 function install_themes_dashboard() {
    97         install_theme_search_form( false );
    98 ?>
    99 <h4><?php _e('Feature Filter') ?></h4>
    100 <p class="install-help"><?php _e( 'Find a theme based on specific features.' ); ?></p>
    101 
    102 <form method="get" action="">
    103         <input type="hidden" name="tab" value="search" />
    104         <?php
    105         $feature_list = get_theme_feature_list();
    106         echo '<div class="feature-filter">';
    107 
    108         foreach ( (array) $feature_list as $feature_name => $features ) {
    109                 $feature_name = esc_html( $feature_name );
    110                 echo '<div class="feature-name">' . $feature_name . '</div>';
    111 
    112                 echo '<ol class="feature-group">';
    113                 foreach ( $features as $feature => $feature_name ) {
    114                         $feature_name = esc_html( $feature_name );
    115                         $feature = esc_attr($feature);
    116 ?>
    117 
    118 <li>
    119         <input type="checkbox" name="features[]" id="feature-id-<?php echo $feature; ?>" value="<?php echo $feature; ?>" />
    120         <label for="feature-id-<?php echo $feature; ?>"><?php echo $feature_name; ?></label>
    121 </li>
    122 
    123 <?php   } ?>
    124 </ol>
    125 <br class="clear" />
    126 <?php
    127         } ?>
    128 
    129 </div>
    130 <br class="clear" />
    131 <?php submit_button( __( 'Find Themes' ), 'button', 'search' ); ?>
    132 </form>
    133 <?php
    134 }
    135 // add_action('install_themes_dashboard', 'install_themes_dashboard');
    136 
     10 * Used in wp-admin/theme-install.php
     11 **/
    13712function install_themes_upload() {
    13813?>
    13914<p class="install-help"><?php _e('If you have a theme in a .zip format, you may install it by uploading it here.'); ?></p>
     
    14520        <?php
    14621}
    14722// add_action('install_themes_upload', 'install_themes_upload', 10, 0);
    148 
    149 /**
    150  * Prints a theme on the Install Themes pages.
    151  *
    152  * @deprecated 3.4.0
    153  */
    154 function display_theme( $theme ) {
    155         _deprecated_function( __FUNCTION__, '3.4' );
    156         global $wp_list_table;
    157         if ( ! isset( $wp_list_table ) ) {
    158                 $wp_list_table = _get_list_table('WP_Theme_Install_List_Table');
    159         }
    160         $wp_list_table->prepare_items();
    161         $wp_list_table->single_row( $theme );
    162 }
    163 
    164 /**
    165  * Display theme content based on theme list.
    166  *
    167  * @since 2.8.0
    168  */
    169 function display_themes() {
    170         global $wp_list_table;
    171 
    172         if ( ! isset( $wp_list_table ) ) {
    173                 $wp_list_table = _get_list_table('WP_Theme_Install_List_Table');
    174         }
    175         $wp_list_table->prepare_items();
    176         $wp_list_table->display();
    177 
    178 }
    179 // add_action('install_themes_search', 'display_themes');
    180 // add_action('install_themes_featured', 'display_themes');
    181 // add_action('install_themes_new', 'display_themes');
    182 // add_action('install_themes_updated', 'display_themes');
    183 
    184 /**
    185  * Display theme information in dialog box form.
    186  *
    187  * @since 2.8.0
    188  */
    189 function install_theme_information() {
    190         global $wp_list_table;
    191 
    192         $theme = themes_api( 'theme_information', array( 'slug' => wp_unslash( $_REQUEST['theme'] ) ) );
    193 
    194         if ( is_wp_error( $theme ) )
    195                 wp_die( $theme );
    196 
    197         iframe_header( __('Theme Install') );
    198         if ( ! isset( $wp_list_table ) ) {
    199                 $wp_list_table = _get_list_table('WP_Theme_Install_List_Table');
    200         }
    201         $wp_list_table->theme_installer_single( $theme );
    202         iframe_footer();
    203         exit;
    204 }
    205 add_action('install_themes_pre_theme-information', 'install_theme_information');