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

WordPress Trac noreply at wordpress.org
Thu Jul 2 14:58:38 UTC 2020


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

 * version:  3.4.1 =>


Comment:

 Personally I would love to use `$args`, but this looks like it will break
 any existing template part that is using a global `$args` which would now
 get reset to an empty array with this patch.

 Can we change the name of the parameter to e.g. `$__wp_args` and then if
 any value is passed in, copy it into an `$args` variable?

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


More information about the wp-trac mailing list