[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:19:29 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 johnjamesjacoby):

 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.

 The flaw with the before/after logic is that this information may not
 truly exist in a physical place directly before or after the_content(). It
 might be after the content AND after a bio of the author, but before the
 prev/next navigation and comment river. Due to the unpredictability of
 theme layouts and needs, that approach doesn't apply to this scenario. It
 is however an approach that I am in agreement with, just not to solve this
 particular problem. :)

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


More information about the wp-trac mailing list