TBPingFilter
This callback is invoked just prior to the MT::TBPing
object being saved. The callback is invoked prior to any spam/junk filtering or scoring being performed on the ping. This callback is a way for plugins to intercept the submission of any newly submitted ping and perform additional validation on the ping.
If any TrackBack ping filter callback returns false (zero), the ping will not be saved in the database.
Input Parameters
- $cb - a reference to the current
MT::Callback
object handling this event. - $app - An instance of the
MT::App::Trackbacks
used to process this comment submission. - $ping - The
MT::Comment
object.
Return Value
A boolean (true/false) value. If any TrackBack filter callback returns false (zero), the corresponding TrackBack ping will not be saved in the database.
Example Handler
sub handler {
my ($cb, $app, $ping) = @_;
if ($ping->text =~ /a bad word/gm) {
MT::Log->log({message => "Not saving ping
because it has a bad word in it."})
return 0;
}
return 1;
}