3 function current_theme_info() {
4 $themes = get_themes();
5 $current_theme = get_current_theme();
6 $ct->name = $current_theme;
7 $ct->title = $themes[$current_theme]['Title'];
8 $ct->version = $themes[$current_theme]['Version'];
9 $ct->parent_theme = $themes[$current_theme]['Parent Theme'];
10 $ct->template_dir = $themes[$current_theme]['Template Dir'];
11 $ct->stylesheet_dir = $themes[$current_theme]['Stylesheet Dir'];
12 $ct->template = $themes[$current_theme]['Template'];
13 $ct->stylesheet = $themes[$current_theme]['Stylesheet'];
14 $ct->screenshot = $themes[$current_theme]['Screenshot'];
15 $ct->description = $themes[$current_theme]['Description'];
16 $ct->author = $themes[$current_theme]['Author'];
17 $ct->tags = $themes[$current_theme]['Tags'];
21 function get_broken_themes() {
22 global $wp_broken_themes;
25 return $wp_broken_themes;
28 function get_page_templates() {
29 $themes = get_themes();
30 $theme = get_current_theme();
31 $templates = $themes[$theme]['Template Files'];
32 $page_templates = array ();
34 if ( is_array( $templates ) ) {
35 foreach ( $templates as $template ) {
36 $template_data = implode( '', file( WP_CONTENT_DIR.$template ));
38 preg_match( '|Template Name:(.*)$|mi', $template_data, $name );
39 preg_match( '|Description:(.*)$|mi', $template_data, $description );
42 $description = $description[1];
44 if ( !empty( $name ) ) {
45 $page_templates[trim( $name )] = basename( $template );
50 return $page_templates;