Jump to content

Extension:Comments/Hooks/Comments::isSpam

From mediawiki.org
Comments::isSpam
Available from version ???
Used to determine if the supplied input is spam or not.
Define function:
public static function onComments_isSpam( &$text, &$retVal ) { ... }
Attach hook:
$wgHooks['Comments::isSpam'][] = 'MyExtensionHooks::onComments_isSpam';
Called from:
File(s): Comments / includes/CommentFunctions.php
Function(s): isSpam

For more information about attaching hooks, see Manual:Hooks .
For examples of other extensions using this hook, see Category:Comments::isSpam extensions.

The Comments::isSpam hook is called in the method with the same name, to determine if the supplied input (&$text) is spam or not. Subscribers can set the return value of &$retVal to true to indicate that the input is spam and to halt the adding of a comment determined to contain spam.

As of Q3/2025 only the SpamRegex extension makes use of this hook.