Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm writing a plugin that needs to display a custom link immediately near the comments. I have the option in the plugin admin to display before or after. I'm familiar with the comments_array, but that doesn't allow me to just add a string of html just before the comments or just after the comments but before the comment form.

the_content
-- ?? custom link before ?? --
comments_array
-- ?? custom link after ?? --
comment_form
share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

do_action( 'comment_form_before' ); is called on line 1553 of /wp-includes/comment-template.php, right before the output of the comment form, that should handle that one for you. I'll update this if I can find the hook before the comments.

edit

It seems like you might be able to modify Walker_Comment (found in the same file as above) to output the first link with __construct or something, but I can't give you precise implementation at the moment (for lack of time).

share|improve this answer
    
Yes, I was able to use the do_action to at least place the html before the form, after the comments_array. –  Beer Jan 16 '12 at 15:26
add comment

I think, this is the post, that you search; all hooks on comments form visualized: http://wpengineer.com/2205/comment-form-hooks-visualized/

alternativ all hooks:

  • comment_form_before
  • comment_form_top
  • comment_form_before_fields
  • comment_form_after_fields
  • comment_form
  • comment_form_after
share|improve this answer
    
Thanks, it's a nice way to visualize those hooks but they're all about the comment_form and I needed to place html before/after the comments_array. –  Beer Jan 16 '12 at 15:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.