Changeset 42343 for trunk/src/wp-admin/includes/theme-install.php
- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/theme-install.php
r41289 r42343 7 7 */ 8 8 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()) 9 $themes_allowedtags = array( 10 'a' => array( 11 'href' => array(), 12 'title' => array(), 13 'target' => array(), 14 ), 15 'abbr' => array( 'title' => array() ), 16 'acronym' => array( 'title' => array() ), 17 'code' => array(), 18 'pre' => array(), 19 'em' => array(), 20 'strong' => array(), 21 'div' => array(), 22 'p' => array(), 23 'ul' => array(), 24 'ol' => array(), 25 'li' => array(), 26 'h1' => array(), 27 'h2' => array(), 28 'h3' => array(), 29 'h4' => array(), 30 'h5' => array(), 31 'h6' => array(), 32 'img' => array( 33 'src' => array(), 34 'class' => array(), 35 'alt' => array(), 36 ), 15 37 ); 16 38 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 39 $theme_field_defaults = array( 40 'description' => true, 41 'sections' => false, 42 'tested' => true, 43 'requires' => true, 44 'rating' => true, 45 'downloaded' => true, 46 'downloadlink' => true, 47 'last_updated' => true, 48 'homepage' => true, 49 'tags' => true, 50 'num_ratings' => true, 20 51 ); 21 52 … … 32 63 _deprecated_function( __FUNCTION__, '3.1.0', 'get_theme_feature_list()' ); 33 64 34 if ( ! $cache = get_transient( 'wporg_theme_feature_list' ) )65 if ( ! $cache = get_transient( 'wporg_theme_feature_list' ) ) { 35 66 set_transient( 'wporg_theme_feature_list', array(), 3 * HOUR_IN_SECONDS ); 36 37 if ( $cache ) 67 } 68 69 if ( $cache ) { 38 70 return $cache; 71 } 39 72 40 73 $feature_list = themes_api( 'feature_list', array() ); 41 if ( is_wp_error( $feature_list ) ) 74 if ( is_wp_error( $feature_list ) ) { 42 75 return array(); 76 } 43 77 44 78 set_transient( 'wporg_theme_feature_list', $feature_list, 3 * HOUR_IN_SECONDS ); … … 57 91 $type = isset( $_REQUEST['type'] ) ? wp_unslash( $_REQUEST['type'] ) : 'term'; 58 92 $term = isset( $_REQUEST['s'] ) ? wp_unslash( $_REQUEST['s'] ) : ''; 59 if ( ! $type_selector ) 93 if ( ! $type_selector ) { 60 94 echo '<p class="install-help">' . __( 'Search for themes by keyword.' ) . '</p>'; 95 } 61 96 ?> 62 97 <form id="search-themes" method="get"> 63 98 <input type="hidden" name="tab" value="search" /> 64 99 <?php if ( $type_selector ) : ?> 65 <label class="screen-reader-text" for="typeselector"><?php _e( 'Type of search'); ?></label>100 <label class="screen-reader-text" for="typeselector"><?php _e( 'Type of search' ); ?></label> 66 101 <select name="type" id="typeselector"> 67 <option value="term" <?php selected( 'term', $type) ?>><?php _e('Keyword'); ?></option>68 <option value="author" <?php selected( 'author', $type) ?>><?php _e('Author'); ?></option>69 <option value="tag" <?php selected( 'tag', $type) ?>><?php _ex('Tag', 'Theme Installer'); ?></option>102 <option value="term" <?php selected( 'term', $type ); ?>><?php _e( 'Keyword' ); ?></option> 103 <option value="author" <?php selected( 'author', $type ); ?>><?php _e( 'Author' ); ?></option> 104 <option value="tag" <?php selected( 'tag', $type ); ?>><?php _ex( 'Tag', 'Theme Installer' ); ?></option> 70 105 </select> 71 <label class="screen-reader-text" for="s"><?php 106 <label class="screen-reader-text" for="s"> 107 <?php 72 108 switch ( $type ) { 73 109 case 'term': … … 81 117 break; 82 118 } 83 ?></label> 119 ?> 120 </label> 84 121 <?php else : ?> 85 <label class="screen-reader-text" for="s"><?php _e( 'Search by keyword'); ?></label>122 <label class="screen-reader-text" for="s"><?php _e( 'Search by keyword' ); ?></label> 86 123 <?php endif; ?> 87 <input type="search" name="s" id="s" size="30" value="<?php echo esc_attr( $term)?>" autofocus="autofocus" />124 <input type="search" name="s" id="s" size="30" value="<?php echo esc_attr( $term ); ?>" autofocus="autofocus" /> 88 125 <?php submit_button( __( 'Search' ), '', 'search', false ); ?> 89 126 </form> … … 99 136 install_theme_search_form( false ); 100 137 ?> 101 <h4><?php _e( 'Feature Filter')?></h4>138 <h4><?php _e( 'Feature Filter' ); ?></h4> 102 139 <p class="install-help"><?php _e( 'Find a theme based on specific features.' ); ?></p> 103 140 … … 115 152 foreach ( $features as $feature => $feature_name ) { 116 153 $feature_name = esc_html( $feature_name ); 117 $feature = esc_attr($feature);154 $feature = esc_attr( $feature ); 118 155 ?> 119 156 … … 127 164 <br class="clear" /> 128 165 <?php 129 } ?> 166 } 167 ?> 130 168 131 169 </div> … … 141 179 function install_themes_upload() { 142 180 ?> 143 <p class="install-help"><?php _e( 'If you have a theme in a .zip format, you may install it by uploading it here.'); ?></p>144 <form method="post" enctype="multipart/form-data" class="wp-upload-form" action="<?php echo self_admin_url( 'update.php?action=upload-theme'); ?>">181 <p class="install-help"><?php _e( 'If you have a theme in a .zip format, you may install it by uploading it here.' ); ?></p> 182 <form method="post" enctype="multipart/form-data" class="wp-upload-form" action="<?php echo self_admin_url( 'update.php?action=upload-theme' ); ?>"> 145 183 <?php wp_nonce_field( 'theme-upload' ); ?> 146 184 <label class="screen-reader-text" for="themezip"><?php _e( 'Theme zip file' ); ?></label> … … 164 202 global $wp_list_table; 165 203 if ( ! isset( $wp_list_table ) ) { 166 $wp_list_table = _get_list_table( 'WP_Theme_Install_List_Table');204 $wp_list_table = _get_list_table( 'WP_Theme_Install_List_Table' ); 167 205 } 168 206 $wp_list_table->prepare_items(); … … 181 219 182 220 if ( ! isset( $wp_list_table ) ) { 183 $wp_list_table = _get_list_table( 'WP_Theme_Install_List_Table');221 $wp_list_table = _get_list_table( 'WP_Theme_Install_List_Table' ); 184 222 } 185 223 $wp_list_table->prepare_items(); … … 200 238 $theme = themes_api( 'theme_information', array( 'slug' => wp_unslash( $_REQUEST['theme'] ) ) ); 201 239 202 if ( is_wp_error( $theme ) ) 240 if ( is_wp_error( $theme ) ) { 203 241 wp_die( $theme ); 204 205 iframe_header( __('Theme Installation') ); 242 } 243 244 iframe_header( __( 'Theme Installation' ) ); 206 245 if ( ! isset( $wp_list_table ) ) { 207 $wp_list_table = _get_list_table( 'WP_Theme_Install_List_Table');246 $wp_list_table = _get_list_table( 'WP_Theme_Install_List_Table' ); 208 247 } 209 248 $wp_list_table->theme_installer_single( $theme );
Note: See TracChangeset
for help on using the changeset viewer.