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

WordPress Trac noreply at wordpress.org
Thu Jul 2 15:00:05 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:
-------------------------------------+-----------------------------

Comment (by johnbillion):

 Example code for my previous comment:

 {{{
 $args = [ 1, 2, 3 ];

 get_template_part( 'foo' );
 }}}

 The `foo.php` template part will now see `$args` as an empty array instead
 of the expected value.

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


More information about the wp-trac mailing list