From dd36b37254279b21e4eef7b9b92adb7567cea86a Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Fri, 13 Nov 2009 22:40:40 +0000 Subject: [PATCH] Ensure that page templates in a subdir of a theme work correctly. Fixes #10959 based on patch from scribu. git-svn-id: https://develop.svn.wordpress.org/trunk@12187 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/theme.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/theme.php b/wp-admin/includes/theme.php index 4593feee52..121a4352c1 100644 --- a/wp-admin/includes/theme.php +++ b/wp-admin/includes/theme.php @@ -117,11 +117,11 @@ function get_broken_themes() { } /** - * {@internal Missing Short Description}} + * Get the Page Templates available in this theme * * @since unknown * - * @return unknown + * @return array Key is template name, Value is path within the theme folder */ function get_page_templates() { $themes = get_themes(); @@ -138,7 +138,7 @@ function get_page_templates() { $name = _cleanup_header_comment($name[1]); if ( !empty( $name ) ) { - $page_templates[trim( $name )] = basename( $template ); + $page_templates[trim( $name )] = str_replace(get_template_directory(), '', $template); } } }