有朋自远方来,不亦乐乎。
wordpress常见的action钩子大全(二)
原创 橘子书  18 May/04 1.07K 4 A+

, 通知服务, 和引用动作

comment_closed

原文:Runs when the post is marked as not allowing comments while trying to display comment entry form. Action function argument: post ID.

翻译:当post标记为不允许评论,试着去显示评论表单时。参数:post ID

comment_id_not_found

原文:Runs when the post ID is not found while trying to display comments or comment entry form. Action function argument: post ID.

评论:当post ID不存在,试图显示评论或评论表单时。参数:post ID

comment_flood_trigger

原文:Runs when a comment flood is detected, just before wp_die is called to stop the comment from being accepted. Action function arguments: time of previous comment, time of current comment.

翻译:当一个评论流被检查到,仅在wp_die被调用去停止表单接受前。参数:以前的评论时间,当前评论时间。

comment_(old status)_to_(new status)

原文:Runs when a comment status transition occurs. Action function arguments: Comment object.

翻译:评论状态改变时。参数:Comment object

comment_on_draft

原文:Runs when the post is a draft while trying to display a comment entry form or comments. Action function argument: post ID.

翻译:当post是一个草稿文档,试图显示评论。参数:post ID

comment_post

原文:Runs just after a comment is saved in the database. Action function arguments: comment ID, approval status (“spam”, or 0/1 for disapproved/approved).

翻译:在评论被保存在数据库后。参数:comment ID,approval status(选项:“spam”,”disapproved”,”approved”)

注意spam=垃圾评论,disapproved=不批准,approved=批准,(用 0/1 来表示 不批准/批准).

edit_comment

原文:Runs after a comment is updated/edited in the database. Action function arguments: comment ID.

翻译:在评论被编辑之后,参数:comment ID.

delete_comment

原文:Runs just before a comment is deleted. Action function arguments: comment ID.

翻译:在评论被删除前,参数:comment ID.

deleted_comment

原文:Runs just after a comment is deleted. Action function arguments: comment ID.

翻译:在评论被删除后,参数:comment ID.

trash_comment

原文:Runs just before a comment is trashed. Action function arguments: comment ID.

翻译:在评论移除到回收站前,

trashed_comment

原文:Runs just after a comment is trashed. Action function arguments: comment ID.

翻译:在评论移除到回收站后

comment_closed

原文:Runs when the post is marked as not a spam.

翻译:当post被标记为不是一个草稿文档时

pingback_post

原文:Runs when a ping is added to a post. Action function argument: comment ID.

翻译:当一个ping通知功能被添加到post,comment ID.

pre_ping

原文:Runs before a ping is fully processed. Action function arguments: array of the post links to be processed, and the “pung” setting for the post.

翻译:在ping通知服务处理前,参数:array of the post links to be processed, and the “pung” setting for the post.

trackback_post

原文:Runs when a trackback is added to a post. Action function argument: comment ID.

翻译:当一个trackback被添加到文章。参数:comment ID.

wp_blacklist_check

原文:Runs to check whether a comment should be blacklisted. Action function arguments: author name, author email, author URL, comment text, author IP address, author’s user agent (browser). Your function can execute a wp_die to reject the comment, or perhaps modify one of the input arguments so that it will contain one of the blacklist keywords set in the WordPress options.

翻译:当一个评论被列入黑名单。

wp_insert_comment

原文:Runs whenever a comment is created.

翻译:每当一个评论被创建时。

wp_set_comment_status

原文:Runs when the status of a comment changes. Action function arguments: comment ID, status string indicating the new status (“delete”, “approve”, “spam”, “hold”).

翻译:当评论状态改变时。参数:comment ID, status

 

阅读全文

目前评论:4   其中:访客  2   博主  2

发表评论

莫慌,小狮子正在努力加载评论...
  1. 龙笑天
    龙笑天3 ( 2018.05.04 20:57:30 )  板凳

    看着英文就头晕怎么破~~ :???:

  2. 西枫里博客
    西枫里博客3 ( 2018.05.04 11:09:53 )  沙发

    等大佬更完,我把全部拷贝出来,当手册用 :lol: