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

WordPress Trac wp-trac at lists.automattic.com
Thu Sep 1 20:14:31 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 jb510):

 Replying to [comment:57 aaroncampbell]:
 > This thicket was moving so fast this morning that I couldn't post to it!
 Anyway, I'm with Otto that editing something that exists is a better idea.
 However, to give the flexibility that Jane is looking for I don't think
 you can assume that the end of any given template file is the correct
 place to put the post extras.  Not to mention, themes can call files
 whatever they want when using get_template_part, so how would a plugin
 know WHICH file to hook to?
 >
 > I think using hooks like 'before_post_content' and 'after_post_content'
 makes the most sense, but a plugin needs to be able to fall back to using
 the the_content filter if those don't exist, so I think using
 `add_theme_support()` make sense (basically just what [comment:3
 mikeschinkel] and [comment:48 greenshady] said).  The disadvantage is that
 until now we've only asked theme authors to add something like `do_action(
 'wp_head' )` but it would be best to have them all this one like
 `do_action( 'after_post_content', $post )`.  I'm always cleaning up after
 poorly coded plugins that are overwriting the global $post, but if it was
 passed to the action it wouldn't be an issue.

 Aaron gets to the problem I see with template_part which is how any plugin
 author would know what part to rely on.  If plugin authors are just
 creating template parts on their own then they are not going to coincide
 and group properly which I think is what Jane is (wisely) after.  Hooks in
 core would provide a reliable place for plugin authors.  Relying on theme
 support again means that plugin authors can't rely on it and would need to
 write extra conditional code to handle when the theme doesn't offer
 support wouldn't it?

 BTW, was thicket a freudian slip?

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


More information about the wp-trac mailing list