[wp-trac] [WordPress Trac] #11216: Support page templates located in a subdirectory of the theme

WordPress Trac wp-trac at lists.automattic.com
Fri Sep 10 05:04:36 UTC 2010


#11216: Support page templates located in a subdirectory of the theme
-----------------------------+----------------------------------------------
 Reporter:  westi            |       Owner:                
     Type:  feature request  |      Status:  new           
 Priority:  normal           |   Milestone:  Future Release
Component:  Themes           |     Version:  3.1           
 Severity:  normal           |    Keywords:  needs-patch   
-----------------------------+----------------------------------------------

Comment(by rzen):

 It looks like whatever was breaking the page template selector was
 resolved through another patch, because simply removing the lines from
 get_page_template() that prevent including subdirectories allowed
 everything to work as expected.

 To accommodate the 'folder/folder/template.php' hierarchy that nathan
 mentions above (and that I would also like to use) I've modified /wp-
 includes/theme.php to loop through a second level. The variable names
 could probably be better. I also went ahead and added a filter of
 'available_page_templates', at the suggestion of the ever-brilliant
 filosofo, to the output of get_page_template() should theme devs want to
 specify their own array of templates at an even greater depth.

 Let the record show that this was my first attempt ever at patching core
 files. Review the patch at your own risk.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11216#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list