raw
mp-wp_genesis           1 <?php
mp-wp_genesis 2 /**
mp-wp_genesis 3 * WordPress Theme Administration API
mp-wp_genesis 4 *
mp-wp_genesis 5 * @package WordPress
mp-wp_genesis 6 * @subpackage Administration
mp-wp_genesis 7 */
mp-wp_genesis 8
mp-wp_genesis 9 /**
mp-wp_genesis 10 * {@internal Missing Short Description}}
mp-wp_genesis 11 *
mp-wp_genesis 12 * @since unknown
mp-wp_genesis 13 *
mp-wp_genesis 14 * @return unknown
mp-wp_genesis 15 */
mp-wp_genesis 16 function current_theme_info() {
mp-wp_genesis 17 $themes = get_themes();
mp-wp_genesis 18 $current_theme = get_current_theme();
mp-wp_genesis 19 $ct->name = $current_theme;
mp-wp_genesis 20 $ct->title = $themes[$current_theme]['Title'];
mp-wp_genesis 21 $ct->version = $themes[$current_theme]['Version'];
mp-wp_genesis 22 $ct->parent_theme = $themes[$current_theme]['Parent Theme'];
mp-wp_genesis 23 $ct->template_dir = $themes[$current_theme]['Template Dir'];
mp-wp_genesis 24 $ct->stylesheet_dir = $themes[$current_theme]['Stylesheet Dir'];
mp-wp_genesis 25 $ct->template = $themes[$current_theme]['Template'];
mp-wp_genesis 26 $ct->stylesheet = $themes[$current_theme]['Stylesheet'];
mp-wp_genesis 27 $ct->screenshot = $themes[$current_theme]['Screenshot'];
mp-wp_genesis 28 $ct->description = $themes[$current_theme]['Description'];
mp-wp_genesis 29 $ct->author = $themes[$current_theme]['Author'];
mp-wp_genesis 30 $ct->tags = $themes[$current_theme]['Tags'];
mp-wp_genesis 31 return $ct;
mp-wp_genesis 32 }
mp-wp_genesis 33
mp-wp_genesis 34 /**
mp-wp_genesis 35 * {@internal Missing Short Description}}
mp-wp_genesis 36 *
mp-wp_genesis 37 * @since unknown
mp-wp_genesis 38 *
mp-wp_genesis 39 * @return unknown
mp-wp_genesis 40 */
mp-wp_genesis 41 function get_broken_themes() {
mp-wp_genesis 42 global $wp_broken_themes;
mp-wp_genesis 43
mp-wp_genesis 44 get_themes();
mp-wp_genesis 45 return $wp_broken_themes;
mp-wp_genesis 46 }
mp-wp_genesis 47
mp-wp_genesis 48 /**
mp-wp_genesis 49 * {@internal Missing Short Description}}
mp-wp_genesis 50 *
mp-wp_genesis 51 * @since unknown
mp-wp_genesis 52 *
mp-wp_genesis 53 * @return unknown
mp-wp_genesis 54 */
mp-wp_genesis 55 function get_page_templates() {
mp-wp_genesis 56 $themes = get_themes();
mp-wp_genesis 57 $theme = get_current_theme();
mp-wp_genesis 58 $templates = $themes[$theme]['Template Files'];
mp-wp_genesis 59 $page_templates = array ();
mp-wp_genesis 60
mp-wp_genesis 61 if ( is_array( $templates ) ) {
mp-wp_genesis 62 foreach ( $templates as $template ) {
mp-wp_genesis 63 $template_data = implode( '', file( WP_CONTENT_DIR.$template ));
mp-wp_genesis 64
mp-wp_genesis 65 $name = '';
mp-wp_genesis 66 if ( preg_match( '|Template Name:(.*)$|mi', $template_data, $name ) )
mp-wp_genesis 67 $name = $name[1];
mp-wp_genesis 68
mp-wp_genesis 69 $description = '';
mp-wp_genesis 70 if( preg_match( '|Description:(.*)$|mi', $template_data, $description ) )
mp-wp_genesis 71 $description = $description[1];
mp-wp_genesis 72
mp-wp_genesis 73 if ( !empty( $name ) ) {
mp-wp_genesis 74 $page_templates[trim( $name )] = basename( $template );
mp-wp_genesis 75 }
mp-wp_genesis 76 }
mp-wp_genesis 77 }
mp-wp_genesis 78
mp-wp_genesis 79 return $page_templates;
mp-wp_genesis 80 }
mp-wp_genesis 81
mp-wp_genesis 82 ?>