diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-10-12 16:21:15 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-10-12 16:21:15 +0000 |
| commit | 3a4570b0fc8b3d6339bef71d17d7701554e0bbf7 (patch) | |
| tree | 2a06e5261263c68d8afd95a6328879dc289cb909 /wp-admin/includes/theme.php | |
| parent | b83c34a7010faee0223f6037025c350da12e05e6 (diff) | |
| download | wordpress-mu-3a4570b0fc8b3d6339bef71d17d7701554e0bbf7.tar.gz wordpress-mu-3a4570b0fc8b3d6339bef71d17d7701554e0bbf7.tar.xz wordpress-mu-3a4570b0fc8b3d6339bef71d17d7701554e0bbf7.zip | |
Merge with WP 2.3 - testing use only!
Move pluggable functions out of wpmu-functions and into pluggable.php, fixes #439
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1069 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin/includes/theme.php')
| -rw-r--r-- | wp-admin/includes/theme.php | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/wp-admin/includes/theme.php b/wp-admin/includes/theme.php new file mode 100644 index 0000000..bd39dea --- /dev/null +++ b/wp-admin/includes/theme.php @@ -0,0 +1,52 @@ +<?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:(.*)$|mi', $template_data, $name ); + preg_match( '|Description:(.*)$|mi', $template_data, $description ); + + $name = $name[1]; + $description = $description[1]; + + if ( !empty( $name ) ) { + $page_templates[trim( $name )] = basename( $template ); + } + } + } + + return $page_templates; +} + +?> |
