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

WordPress Trac noreply at wordpress.org
Mon Aug 26 19:02:50 UTC 2013


#21676: Pass a variable to get_template_part()
-----------------------------+------------------------------
 Reporter:  sc0ttkclark      |       Owner:
     Type:  enhancement      |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Template         |     Version:  3.4.1
 Severity:  normal           |  Resolution:
 Keywords:  has-patch close  |
-----------------------------+------------------------------

Comment (by c3mdigital):

 Replying to [comment:34 amaschas]:
 >there's currently no good way to get that data into the template without
 using globals. As you can imagine, using globals for this purpose in a
 sufficiently large problem quickly becomes problematic.

 The WordPress way of doing that is with template tags.  There is no reason
 you can't call get_post_meta on the same data more than once if you need
 it, it's already cached for you so there is really no additional overhead.
 You can also cache your own data for use in any template part.  I don't
 discredit your need but I'm still not convinced that a basic template
 function should be used for it.
 +1 close/wontfix

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


More information about the wp-trac mailing list