is there a hook to capture the moment a comment is inserted into a post?
In wordpress docs, they say that ‘edit_post’ works because the comment count on that post is updated, but it doesn’t work.
Thanks
is there a hook to capture the moment a comment is inserted into a post?
In wordpress docs, they say that ‘edit_post’ works because the comment count on that post is updated, but it doesn’t work.
Thanks
You must be logged in to post a comment.
There’s an action hook called “wp_insert_comment” that’s called from
wp_insert_comment()
. It passes the comment id and the new comment as an object. (wp-includes/comment.php on line 1245.)