[wp-trac] [WordPress Trac] #15086: get_template_part() should let you specify a directory

WordPress Trac wp-trac at lists.automattic.com
Wed Oct 13 23:21:19 UTC 2010


#15086: get_template_part() should let you specify a directory
---------------------------+------------------------------------------------
 Reporter:  aaroncampbell  |       Owner:             
     Type:  defect (bug)   |      Status:  new        
 Priority:  normal         |   Milestone:  3.1        
Component:  Themes         |     Version:  3.0        
 Severity:  normal         |    Keywords:  needs-patch
---------------------------+------------------------------------------------

Comment(by aaroncampbell):

 So what do you think should happen if someone calls it like this:
 {{{
 get_template_part( 'something/somewhere/somefile', 'somename',
 'somedir/anotherdir' );
 }}}

 Should it look for `somedir/anotherdir/somethingsomewheresomefile-
 somename.php` or should it look for `somedir/anotherdir/somefile-
 somename.php`.  My patch does the latter, and not splitting up $slug (just
 sanitizing it with `sanitize_file_name`) would accomplish the former.

 Either way, that's pretty minor (I can easily do it either way).  The real
 question is whether or not we're keeping up Simple Pie (I thought that we
 were, but I want to make sure).  If we are, I'll pull out
 `remove_dot_segments()`, put it in `wp-includes/formatting.php`, and start
 using it.  If not, maybe we roll it into the start of our own version of
 this function?

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


More information about the wp-trac mailing list