CommentThrottleFilter

This callback is invoked as soon as a new comment has been received, but prior to the comment being instantiated. If the callback returns false (zero), then the comment will be discarded and the Movable Type will output an error page about throttling. When more than one CommentThrottleFilter are chained together, the data is discarded unless all callbacks return true.

Input Parameters

  • $cb - a reference to the current MT::Callback object handling this event.
  • $app - the MT::App::Comments object, whose interface is documented in MT::App::Comments
  • $entry - the entry on which the comment is to be placed.

You may notice that no comment object (MT::Comment) is passed to the callback because it has not yet been built. This has the advantage of allowing this callback to short circuit the commenting process before before much processing and overhead takes place.

Return Value

A boolean (true/false) value. If any comment throttle filter callback returns false (zero), the corresponding comment will not be saved in the database, and Movable Type will display an error to the user about their comment being "throttled."

Example Handler

sub comment_throttle_filter {
    my ($cb, $app, $entry) = @_;
}
This page was last updated on 2008-10-01, 16:59.

Leave a note

Have a question? Please use the MT Forums. Notes submitted on documentation should pertain to tips & hints regarding documentation. Your note may be removed once its contents have been integrated into the body of the page.