Ticket #16868: theme_add_version.php.diff
File theme_add_version.php.diff, 3.4 KB (added by , 14 years ago) |
---|
-
wp-includes/theme.php
170 170 * <b>code</b>, <b>em</b>, and <b>strong</b> elements also allowed. 171 171 * 172 172 * The style.css file must contain theme name, theme URI, and description. The 173 * data can also contain author URI, author, template (parent template),174 * version, status, and finally tags. Some of these are not used by WordPress175 * administration panels, but are used by theme directory web sites which list176 * the theme.173 * data can also contain the WordPress version required, the version tested to, 174 * author URI, author, template (parent template), version, status, and finally 175 * tags. Some of these are not used by WordPress administration panels, but are 176 * used by theme directory web sites which list the theme. 177 177 * 178 178 * @since 1.5.0 179 179 * … … 182 182 */ 183 183 function get_theme_data( $theme_file ) { 184 184 $default_headers = array( 185 'Required' => 'WordPress Version Required', 186 'Tested' => 'Tested Up To', 185 187 'Name' => 'Theme Name', 186 188 'URI' => 'Theme URI', 187 189 'Description' => 'Description', … … 209 211 ); 210 212 211 213 $theme_data = get_file_data( $theme_file, $default_headers, 'theme' ); 214 215 $theme_data['Required'] = wp_kses( $theme_data['Required'], $themes_allowed_tags ); 216 217 $theme_data['Tested'] = wp_kses( $theme_data['Tested'], $themes_allowed_tags ); 212 218 213 219 $theme_data['Name'] = $theme_data['Title'] = wp_kses( $theme_data['Name'], $themes_allowed_tags ); 214 220 … … 284 290 } 285 291 286 292 $theme_data = get_theme_data("$theme_root/$theme_file"); 293 294 $wp_version_required = $theme_data['Required']; 295 $wp_version_tested = $theme_data['Tested']; 296 $name = $theme_data['Name']; 297 $title = $theme_data['Title']; 298 $description = wptexturize($theme_data['Description']); 299 $version = $theme_data['Version']; 300 $author = $theme_data['Author']; 301 $template = $theme_data['Template']; 302 $stylesheet = dirname($theme_file); 287 303 288 $name = $theme_data['Name'];289 $title = $theme_data['Title'];290 $description = wptexturize($theme_data['Description']);291 $version = $theme_data['Version'];292 $author = $theme_data['Author'];293 $template = $theme_data['Template'];294 $stylesheet = dirname($theme_file);295 296 304 $screenshot = false; 297 305 foreach ( array('png', 'gif', 'jpg', 'jpeg') as $ext ) { 298 306 if (file_exists("$theme_root/$stylesheet/screenshot.$ext")) { … … 301 309 } 302 310 } 303 311 312 /* Test if WordPress Versions have been set for Required and Tested else set to version 0.0 */ 313 /* TO-DO: value set to '0.0' for use in comparison tests - change to 'unknown'? */ 314 if ( empty( $wp_version_required ) ) 315 $wp_version_required = '0.0'; 316 317 if ( empty( $wp_version_tested ) ) 318 $wp_version_tested = '0.0'; 319 304 320 if ( empty($name) ) { 305 321 $name = dirname($theme_file); 306 322 $title = $name; … … 417 433 418 434 $theme_roots[$stylesheet] = str_replace( WP_CONTENT_DIR, '', $theme_root ); 419 435 $wp_themes[$name] = array( 436 'Required' => $wp_version_required, 437 'Tested' => $wp_version_tested, 420 438 'Name' => $name, 421 439 'Title' => $title, 422 440 'Description' => $description, … … 1879 1897 1880 1898 add_action( 'delete_attachment', '_delete_attachment_theme_mod' ); 1881 1899 1882 ?> 1900 ?> 1901 No newline at end of file