views:

21

answers:

1

hi all , I'm writing a wordpress plugin that will execute a certain function when a user submits a comment. The only issue is I'm using the hook "comment_post" which works but if that comment gets stopped by akismet I'm still logging that comment but now my numbers are off from what's on the actual site. Is there a comment_approved type hook I should be using instead?

thanks!

A: 

this is something I was looking at not too long ago, Only thing is the admin has to approve/edit the comment before the function would run..

using the wordpress admin hook:

wp_set_comment_status()

This function is run after changing the status of the comment by the admin.., this looks for the status from 4 options

status ("delete", "approve", "spam", "hold"). 

You can check for the status approve? do your caculation from there?

Marty
thanks Marty, I'll take a look at this today and see if it works out