开发者

trying to find the comment hook I need for wordpress?

开发者 https://www.devze.com 2022-12-23 21:43 出处:网络
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 i开发者_运维百科f that commen

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 i开发者_运维百科f 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?


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?

0

精彩评论

暂无评论...
验证码 换一张
取 消