mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-04 22:57:20 +00:00
Admin includes reorg. see #4334
git-svn-id: https://develop.svn.wordpress.org/trunk@5542 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
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'];
|
||||
return $ct;
|
||||
}
|
||||
|
||||
function get_broken_themes() {
|
||||
global $wp_broken_themes;
|
||||
|
||||
get_themes();
|
||||
return $wp_broken_themes;
|
||||
}
|
||||
|
||||
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 ) {
|
||||
$template_data = implode( '', file( ABSPATH.$template ));
|
||||
preg_match( "|Template Name:(.*)|i", $template_data, $name );
|
||||
preg_match( "|Description:(.*)|i", $template_data, $description );
|
||||
|
||||
$name = $name[1];
|
||||
$description = $description[1];
|
||||
|
||||
if (!empty ( $name ) ) {
|
||||
$page_templates[trim( $name )] = basename( $template );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $page_templates;
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user