[wp-trac] Re: [WordPress Trac] #10215: Page Templates found in
sub-dirs, but not usable
WordPress Trac
wp-trac at lists.automattic.com
Sun Jun 21 04:02:13 GMT 2009
#10215: Page Templates found in sub-dirs, but not usable
--------------------------+-------------------------------------------------
Reporter: alexkingorg | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 2.9
Component: Template | Version: 2.8
Severity: normal | Keywords:
--------------------------+-------------------------------------------------
Comment(by dd32):
This is caused by {{{basename()}}} on line 139:
http://core.trac.wordpress.org/browser/trunk/wp-
admin/includes/theme.php#L139
that could be changed like such:
{{{
if ( !empty( $name ) ) {
$template = preg_replace('#^' .
preg_quote(get_theme_root(), '#') . '/[^/]+/#i', '', WP_CONTENT_DIR .
$template);
$page_templates[trim( $name )] =
$template;
}
}}}
and it'll work as expected..
but i'm questioning this entire function logic at present,
get_theme_root() allows you to filter on 'theme_root' which allows you to
move it out of WP_CONTENT_DIR.. right now, this is not respecting that at
all due to the hard-coded WP_CONTENT_DIR, Thus my usage of
get_theme_root() there.. But its still got a hard-coded dir...
--
Ticket URL: <http://core.trac.wordpress.org/ticket/10215#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list