[wp-trac] [WordPress Trac] #21676: Pass a variable to get_template_part()

WordPress Trac noreply at wordpress.org
Thu Jan 24 00:55:53 UTC 2013


#21676: Pass a variable to get_template_part()
-------------------------------------------------+-------------------------
 Reporter:  sc0ttkclark                          |       Owner:
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Future
Component:  Template                             |  Release
 Severity:  normal                               |     Version:  3.4.1
 Keywords:  has-patch needs-testing dev-         |  Resolution:
  feedback 2nd-opinion                           |
-------------------------------------------------+-------------------------

Comment (by beatpanda):

 This comes up ''a lot'' in my work, and some of my plugins and themes
 would be ''drastically'' better if this was core functionality. Right now
 I'm having to implement my own version of WordPress core functions to do
 this.

 I know this isn't likely to happen, but if the $data array used the
 EXTR_OVERWRITE option instead of EXTR_SKIP, that would be ''extremely''
 helpful, because then I could pass in a custom set of posts to a template
 as $posts or $post in the $data array and the template would still "just
 work".

 I came here to submit roughly this exact patch, which is roughly what my
 hacky implementation looks like. Please implement this.

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


More information about the wp-trac mailing list