I am trying to find reference for comment_post to insert custom data to custom table when comment post.
I want to insert below things to my custom table
- Comment’s Post ID
- Custom content (which will done with custom query)
Can anyone please help me to do this?
Not sure what you’re after but this is how you would get the content of a newly posted comment
Is that what you’re looking for?
Your question is not very clear, but I think you are looking for the
wp_insert_comment
hook or one of the comment transitions hooks. Your question doesn’t allow for a more detailed answer. There just isn’t enough information.See Also: http://codex.wordpress.org/Function_Reference/wp_transition_comment_status
I have done this using comment_post action hook. Here is the answer if anyone need in future.