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

WordPress Trac noreply at wordpress.org
Mon Aug 26 19:12:18 UTC 2013


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

Comment (by ysalame):

 Replying to [comment:36 wonderboymusic]:
 > > Multiple times I had the need to go around get_template_part() because
 of this limitation
 >
 > I go around XML all the time by using JSON

 The choice between XML and JSON is an "implementation" choice not a "best
 practice" choice. You cannot argue best practice against JSON or XML or
 any other structured data since they depende on your environment. But
 putting any data not needed within a global scope inside the globals
 variable just to avoid passing a variable, for me, is bad practice.

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


More information about the wp-trac mailing list