[wp-trac] [WordPress Trac] #18561: Better Way to Insert Things Below Individual Posts

WordPress Trac wp-trac at lists.automattic.com
Thu Sep 1 18:41:42 UTC 2011


#18561: Better Way to Insert Things Below Individual Posts
-------------------------+------------------------------
 Reporter:  jane         |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  General      |     Version:  3.2.1
 Severity:  minor        |  Resolution:
 Keywords:               |
-------------------------+------------------------------

Comment (by Otto42):

 Replying to [comment:54 johnjamesjacoby]:
 > That said, I'm all for get_template_part() getting more muscle. It's
 because of a lack of filters and actions that bbPress 2.0 has its own
 wrapper for it: http://bbpress.trac.wordpress.org/browser/branches/plugin
 /bbp-includes/bbp-core-compatibility.php#L82
 >
 > Otto's patch is a good start but get_template_part() could/should be
 much more powerful. Example: bbPress 2.0 uses template parts to power its
 shortcodes so that a theme *can* dictate the appearance if it elects to,
 but it doesn't have to. Template parts are loaded into on output buffer,
 and presented wherever you put them. Easy.

 BTW, I was looking at this the other day, and for your specific use case
 in bbPress, I think a filter down in locate_template makes the most sense.
 Putting this in there would work:

 {{{
 $located = apply_filters( 'locate_template', $located, $template_names );
 }}}

 It allows a plugin to either override any existing template, or find/add a
 different template from a different directory, if needed. This would give
 the functionality you were talking about back in Chicago without the
 wrapper.

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


More information about the wp-trac mailing list