[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:43:54 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 azaozz):

 Replying to [comment:41 Otto42]:
 > There is the_post hook in setup_postdata, however this has the problem
 that it fires before every post's output, and that it has the next post
 already set up by the time it fires. So having it output something
 specific to the previous post is problematic.

 IMHO this is the right hook to use. It fires exactly between the posts.

 We can even split it into two new hooks if need be (don't see the point
 though). Can make 'the_post' to call 'after_the_content' and provide the
 previous $post (can be kept in a `static` or a `global`) followed by
 'before_the_content' and provide the new $post.

 Perhaps it will be simpler to just provide both posts as args, so
 'the_post' will have access to both the previous and next posts. That will
 make it useful in all cases.

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


More information about the wp-trac mailing list