mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-22 08:11:52 +01:00
Ensure that page templates in a subdir of a theme work correctly. Fixes #10959 based on patch from scribu.
git-svn-id: http://svn.automattic.com/wordpress/trunk@12187 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
7a2fa88b6f
commit
9f98c68fd2
@ -117,11 +117,11 @@ function get_broken_themes() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@internal Missing Short Description}}
|
* Get the Page Templates available in this theme
|
||||||
*
|
*
|
||||||
* @since unknown
|
* @since unknown
|
||||||
*
|
*
|
||||||
* @return unknown
|
* @return array Key is template name, Value is path within the theme folder
|
||||||
*/
|
*/
|
||||||
function get_page_templates() {
|
function get_page_templates() {
|
||||||
$themes = get_themes();
|
$themes = get_themes();
|
||||||
@ -138,7 +138,7 @@ function get_page_templates() {
|
|||||||
$name = _cleanup_header_comment($name[1]);
|
$name = _cleanup_header_comment($name[1]);
|
||||||
|
|
||||||
if ( !empty( $name ) ) {
|
if ( !empty( $name ) ) {
|
||||||
$page_templates[trim( $name )] = basename( $template );
|
$page_templates[trim( $name )] = str_replace(get_template_directory(), '', $template);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user