[wp-trac] [WordPress Trac] #23180: Introduce get_plugin_part

WordPress Trac noreply at wordpress.org
Mon Jan 14 07:36:45 UTC 2013


#23180: Introduce get_plugin_part
-----------------------------+------------------------------
 Reporter:  wonderboymusic   |       Owner:
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Plugins          |     Version:
 Severity:  normal           |  Resolution:
 Keywords:  dev-feedback     |
-----------------------------+------------------------------
Changes (by kovshenin):

 * cc: kovshenin (added)


Comment:

 I think we're missing the whole point of `get_template_part` here. It's
 not just an alias for `require`, it's the whole child-parent model which
 allows you to define fallback templates. Unless plugins can adopt a
 similar model, I don't see any value in creating a wrapper function over
 `require`, besides, if you want someone to be able to override the
 included template in your plugin, just pass it through a filter:

 {{{
 require( apply_filters( 'jjj_cat_meow_view', dirname( __FILE__ ) . '/views
 /cat-meow.php' ) );
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23180#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list