2007-05-25 09:16:21 +02:00
|
|
|
<?php
|
2008-10-02 03:03:26 +02:00
|
|
|
/**
|
|
|
|
* WordPress Theme Administration API
|
|
|
|
*
|
|
|
|
* @package WordPress
|
|
|
|
* @subpackage Administration
|
|
|
|
*/
|
2007-05-25 09:16:21 +02:00
|
|
|
|
2008-10-02 03:03:26 +02:00
|
|
|
/**
|
|
|
|
* {@internal Missing Short Description}}
|
|
|
|
*
|
|
|
|
* @since unknown
|
|
|
|
*
|
|
|
|
* @return unknown
|
|
|
|
*/
|
2007-05-25 09:16:21 +02:00
|
|
|
function current_theme_info() {
|
|
|
|
$themes = get_themes();
|
|
|
|
$current_theme = get_current_theme();
|
|
|
|
$ct->name = $current_theme;
|
|
|
|
$ct->title = $themes[$current_theme]['Title'];
|
|
|
|
$ct->version = $themes[$current_theme]['Version'];
|
|
|
|
$ct->parent_theme = $themes[$current_theme]['Parent Theme'];
|
|
|
|
$ct->template_dir = $themes[$current_theme]['Template Dir'];
|
|
|
|
$ct->stylesheet_dir = $themes[$current_theme]['Stylesheet Dir'];
|
|
|
|
$ct->template = $themes[$current_theme]['Template'];
|
|
|
|
$ct->stylesheet = $themes[$current_theme]['Stylesheet'];
|
|
|
|
$ct->screenshot = $themes[$current_theme]['Screenshot'];
|
|
|
|
$ct->description = $themes[$current_theme]['Description'];
|
|
|
|
$ct->author = $themes[$current_theme]['Author'];
|
2007-12-31 19:39:43 +01:00
|
|
|
$ct->tags = $themes[$current_theme]['Tags'];
|
2007-05-25 09:16:21 +02:00
|
|
|
return $ct;
|
|
|
|
}
|
|
|
|
|
2008-10-02 03:03:26 +02:00
|
|
|
/**
|
|
|
|
* {@internal Missing Short Description}}
|
|
|
|
*
|
|
|
|
* @since unknown
|
|
|
|
*
|
|
|
|
* @return unknown
|
|
|
|
*/
|
2007-05-25 09:16:21 +02:00
|
|
|
function get_broken_themes() {
|
|
|
|
global $wp_broken_themes;
|
|
|
|
|
|
|
|
get_themes();
|
|
|
|
return $wp_broken_themes;
|
|
|
|
}
|
|
|
|
|
2008-10-02 03:03:26 +02:00
|
|
|
/**
|
|
|
|
* {@internal Missing Short Description}}
|
|
|
|
*
|
|
|
|
* @since unknown
|
|
|
|
*
|
|
|
|
* @return unknown
|
|
|
|
*/
|
2007-05-25 09:16:21 +02:00
|
|
|
function get_page_templates() {
|
|
|
|
$themes = get_themes();
|
|
|
|
$theme = get_current_theme();
|
|
|
|
$templates = $themes[$theme]['Template Files'];
|
|
|
|
$page_templates = array ();
|
|
|
|
|
|
|
|
if ( is_array( $templates ) ) {
|
|
|
|
foreach ( $templates as $template ) {
|
2008-06-05 01:15:55 +02:00
|
|
|
$template_data = implode( '', file( WP_CONTENT_DIR.$template ));
|
2007-06-14 04:25:30 +02:00
|
|
|
|
2008-08-08 19:05:10 +02:00
|
|
|
$name = '';
|
|
|
|
if ( preg_match( '|Template Name:(.*)$|mi', $template_data, $name ) )
|
|
|
|
$name = $name[1];
|
2007-05-25 09:16:21 +02:00
|
|
|
|
2008-08-08 19:05:10 +02:00
|
|
|
$description = '';
|
|
|
|
if( preg_match( '|Description:(.*)$|mi', $template_data, $description ) )
|
|
|
|
$description = $description[1];
|
2007-05-25 09:16:21 +02:00
|
|
|
|
2007-06-02 02:02:06 +02:00
|
|
|
if ( !empty( $name ) ) {
|
2008-08-16 22:38:07 +02:00
|
|
|
$page_templates[trim( $name )] = basename( $template );
|
2007-05-25 09:16:21 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return $page_templates;
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|