Changeset 4546 for trunk/wp-includes/theme.php
- Timestamp:
- 11/29/2006 11:18:35 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/theme.php
r4469 r4546 56 56 } 57 57 58 function get_theme_data($theme_file) { 59 $theme_data = implode('', file($theme_file)); 60 preg_match("|Theme Name:(.*)|i", $theme_data, $theme_name); 61 preg_match("|Theme URI:(.*)|i", $theme_data, $theme_uri); 62 preg_match("|Description:(.*)|i", $theme_data, $description); 63 preg_match("|Author:(.*)|i", $theme_data, $author_name); 64 preg_match("|Author URI:(.*)|i", $theme_data, $author_uri); 65 preg_match("|Template:(.*)|i", $theme_data, $template); 66 if ( preg_match("|Version:(.*)|i", $theme_data, $version) ) 67 $version = trim($version[1]); 58 function get_theme_data( $theme_file ) { 59 $theme_data = implode( '', file( $theme_file ) ); 60 $theme_data = str_replace ( '\r', '\n', $theme_data ); 61 preg_match( '|Theme Name:(.*)|i', $theme_data, $theme_name ); 62 preg_match( '|Theme URI:(.*)|i', $theme_data, $theme_uri ); 63 preg_match( '|Description:(.*)|i', $theme_data, $description ); 64 preg_match( '|Author:(.*)|i', $theme_data, $author_name ); 65 preg_match( '|Author URI:(.*)|i', $theme_data, $author_uri ); 66 preg_match( '|Template:(.*)|i', $theme_data, $template ); 67 if ( preg_match( '|Version:(.*)|i', $theme_data, $version ) ) 68 $version = trim( $version[1] ); 68 69 else 69 70 $version =''; 70 if ( preg_match( "|Status:(.*)|i", $theme_data, $status) )71 if ( preg_match('|Status:(.*)|i', $theme_data, $status) ) 71 72 $status = trim($status[1]); 72 73 else 73 74 $status = 'publish'; 74 75 75 $description = wptexturize( trim($description[1]));76 $description = wptexturize( trim( $description[1] ) ); 76 77 77 78 $name = $theme_name[1]; 78 $name = trim( $name);79 $name = trim( $name ); 79 80 $theme = $name; 80 81 81 82 if ( '' == $author_uri[1] ) { 82 $author = trim( $author_name[1]);83 $author = trim( $author_name[1] ); 83 84 } else { 84 $author = '<a href="' . trim( $author_uri[1]) . '" title="' . __('Visit author homepage') . '">' . trim($author_name[1]) . '</a>';85 } 86 87 return array( 'Name' => $name, 'Title' => $theme, 'Description' => $description, 'Author' => $author, 'Version' => $version, 'Template' => $template[1], 'Status' => $status);85 $author = '<a href="' . trim( $author_uri[1] ) . '" title="' . __('Visit author homepage') . '">' . trim( $author_name[1] ) . '</a>'; 86 } 87 88 return array( 'Name' => $name, 'Title' => $theme, 'Description' => $description, 'Author' => $author, 'Version' => $version, 'Template' => $template[1], 'Status' => $status ); 88 89 } 89 90
Note: See TracChangeset
for help on using the changeset viewer.