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

WordPress Trac wp-trac at lists.automattic.com
Thu Sep 1 19:08:06 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 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.

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


More information about the wp-trac mailing list