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

WordPress Trac noreply at wordpress.org
Mon Jun 8 21:11:40 UTC 2020


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

Comment (by enrico.sorcinelli):

 I know, there are workarounds for that, like use of globals,
 `get_query_var()`/`set_query_var()` (that internally use global
 `$wp_query` and aren't made specifically for that purpose) or `include(
 locate_template() )` pattern and so on, but a patch like that would really
 clean up those approaches.

 Even if the patch lost a little bit of his appealing (the view part is
 moving toward on the client side), IMHO I think it could be still useful.

 And about the variable name, `$wp_tmpl_args` it's only a proof of concept.
 We can choose a better appropriate name

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/21676#comment:77>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list