[wp-trac] [WordPress Trac] #10959: Inconsistent handling of template files in subdirectories under theme directories

WordPress Trac wp-trac at lists.automattic.com
Sat Nov 14 10:44:08 UTC 2009


#10959: Inconsistent handling of template files in subdirectories under theme
directories
------------------------------------+---------------------------------------
 Reporter:  eyelidlessness          |        Owner:  westi   
     Type:  defect (bug)            |       Status:  reopened
 Priority:  normal                  |    Milestone:  2.9     
Component:  Template                |      Version:  2.8.4   
 Severity:  normal                  |   Resolution:          
 Keywords:  has-patch subdirectory  |  
------------------------------------+---------------------------------------
Changes (by greenshady):

  * status:  closed => reopened
  * resolution:  fixed =>


Comment:

 This change breaks page templates in child themes.  In the `str_replace()`
 function, we are only replacing the `get_template_directory()` (parent
 theme) with `''`.  But, child themes also have their own page templates
 sometimes.  So, we also need to remove `get_stylesheet_directory()` (child
 theme).

 Maybe a change to this on line 141:

 {{{
 $page_templates[trim( $name )] = str_replace( array(
 get_stylesheet_directory(), get_template_directory() ), '', $template );
 }}}

 On a slightly-related note: Should page templates be recognized in sub-
 directories within the child theme?

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


More information about the wp-trac mailing list