钩子文档

wp_check_comment_disallowed_list

💡 云策文档标注

概述

wp_check_comment_disallowed_list 是一个 WordPress 钩子,在检查评论是否包含禁用字符或单词之前触发。它允许开发者在评论被过滤前执行自定义操作。

关键要点

  • 这是一个动作钩子(Action Hook),用于在评论内容被 wp_check_comment_disallowed_list() 函数检查前触发。
  • 钩子传递六个参数:$author(评论作者)、$email(作者邮箱)、$url(作者URL)、$comment(评论内容)、$user_ip(作者IP地址)和 $user_agent(作者浏览器用户代理)。
  • 钩子从 WordPress 5.5.0 版本开始引入。

📄 原文内容

Fires before the comment is tested for disallowed characters or words.

Parameters

$authorstring
Comment author.
$emailstring
Comment author’s email.
$urlstring
Comment author’s URL.
$commentstring
Comment content.
$user_ipstring
Comment author’s IP address.
$user_agentstring
Comment author’s browser user agent.

Source

do_action( 'wp_check_comment_disallowed_list', $author, $email, $url, $comment, $user_ip, $user_agent );

Changelog

Version Description
5.5.0 Introduced.