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

WordPress Trac wp-trac at lists.automattic.com
Mon Oct 11 15:01:07 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):

 What if we did something like this:

  1. Add the third parameter for $directory
  1. Explode $slug on the last DIRECTORY_SEPARATOR
  1. If $directory is empty but we got a directory from exploding $slug,
 use that
  1. Sanitize $slug as we usually do
  1. Sanitize $directory using something like remove_dot_segments() to
 remove any . or .. segments
  1. Evangelize and tell people that the proper way to use directories is
 it to use the third parameter...update docs, etc.
  1. Some day down the road remove the excess code.

 That way would keep backwards compatibility, while still moving us in the
 direction that seems best.

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


More information about the wp-trac mailing list