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

WordPress Trac noreply at wordpress.org
Wed Jul 1 10:28:11 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 apedog):

 If this ticket is adopted I would very much like to see the variables
 extracted into the template's scope. In the same way that {{{query_vars}}}
 are extracted directly into the template's scope.
 This would go a long way towards ease of use of templates with this new
 functionality.

 A decision should be made as to precedence order in case of a variable
 name conflict.
 My view is that in case of a conflict with a {{{query_vars}}} variable
 name, the variables passed to {{{get_template_part}}} should take
 precedence.

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


More information about the wp-trac mailing list