WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #18561, comment 57


Ignore:
Timestamp:
09/02/11 15:30:14 (3 years ago)
Author:
aaroncampbell
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #18561, comment 57

    initial v1  
    11This 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? 
    22 
    3 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. 
     3I 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 call 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.