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.

Whenever a user posts a comment, I'd like to basically have a copy of the post sent to another database for a separate site. The database part is simple, but I can't seem to find the right action hook for this. (I did my testing with a simple echo statement, a failure being it not displaying at all) 'comment_save_pre' would only work when updating a comment, 'wp_set_comment_status' only works when the comment is approved, and 'comment_post' didn't seem to work at all. Does the hook exist?

add_action('...?...', 'on_comment_post');

function on_comment_post($comment){
     echo "Test";
}
share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

You can use wp_insert_comment action, which is triggered on every comment insertion.

share|improve this answer
    
Thank you! That did the trick. –  iRector Sep 15 '12 at 11:57
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.