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

WordPress Trac noreply at wordpress.org
Sun Jun 7 13:50:47 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):

 After a brief conversation on slack during last CD, I just refreshed the
 patch to the current trunk.
 I used  `$wp_tmpl_args` as scoped variable name, but we could chose
 another one in order to avoid possible conflicts.

 Core devs already added this approach in 5.2.0 to `get_search_form()`
 function. For example, **twentytwenty** theme uses it by passing `array(
 'label' => ... )` as scoped arguments to ''searchform.php'' template, so I
 cannot se any reasonable why to don't apply it also to other `get_*`
 template family functions.

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


More information about the wp-trac mailing list