[wp-trac] [WordPress Trac] #21676: Pass a variable to get_template_part()
WordPress Trac
wp-trac at lists.automattic.com
Fri Sep 14 18:25:43 UTC 2012
#21676: Pass a variable to get_template_part()
-------------------------------------+-----------------------------
Reporter: sc0ttkclark | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: Template | Version: 3.4.1
Severity: normal | Resolution:
Keywords: has-patch needs-testing |
-------------------------------------+-----------------------------
Changes (by nacin):
* milestone: 3.5 => Future Release
Comment:
I am not a fan of this.
$_data should always be an array and should be extracted. It should be for
passing variables, not arbitrary data.
Globals and query variables should not be extracted, as they are now. It's
confusing and lame. That means this should not be get_template_part(), and
it should instead be something like wp_load_template() (similar to the old
bb_load_template()).
This would essentially be a new utility function, a clean break from
everything else. get_template_part() is designed for template
modularization and child theme inheritance, let's not complicate it
further.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/21676#comment:10>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list