]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/includes/theme.php
Wordpress 2.7.1
[autoinstalls/wordpress.git] / wp-admin / includes / theme.php
index bd39dea20f74b1c30b72f20629c7f818c073fa76..8b883e23ab1fa2345e3e0f7f82769866ab2b51df 100644 (file)
@@ -1,5 +1,18 @@
 <?php
+/**
+ * WordPress Theme Administration API
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
 function current_theme_info() {
        $themes = get_themes();
        $current_theme = get_current_theme();
@@ -14,9 +27,17 @@ function current_theme_info() {
        $ct->screenshot = $themes[$current_theme]['Screenshot'];
        $ct->description = $themes[$current_theme]['Description'];
        $ct->author = $themes[$current_theme]['Author'];
+       $ct->tags = $themes[$current_theme]['Tags'];
        return $ct;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
 function get_broken_themes() {
        global $wp_broken_themes;
 
@@ -24,6 +45,13 @@ function get_broken_themes() {
        return $wp_broken_themes;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
 function get_page_templates() {
        $themes = get_themes();
        $theme = get_current_theme();
@@ -32,13 +60,15 @@ function get_page_templates() {
 
        if ( is_array( $templates ) ) {
                foreach ( $templates as $template ) {
-                       $template_data = implode( '', file( ABSPATH.$template ));
+                       $template_data = implode( '', file( WP_CONTENT_DIR.$template ));
 
-                       preg_match( '|Template Name:(.*)$|mi', $template_data, $name );
-                       preg_match( '|Description:(.*)$|mi', $template_data, $description );
+                       $name = '';
+                       if ( preg_match( '|Template Name:(.*)$|mi', $template_data, $name ) )
+                               $name = $name[1];
 
-                       $name = $name[1];
-                       $description = $description[1];
+                       $description = '';
+                       if( preg_match( '|Description:(.*)$|mi', $template_data, $description ) )
+                               $description = $description[1];
 
                        if ( !empty( $name ) ) {
                                $page_templates[trim( $name )] = basename( $template );