The application-level callbacks of the MT::App::Comments application are documented here.



Initializes the application and defines the serviceable modes.


Initializes the application to service the request.

$app->do_preview($cgi[, $err])

Handles the comment preview request and displays the preview using the Comment Preview blog template. If $err is specified, the error message is relayed to the user using the Comment Error blog template.


Returns the MT::Blog object related to the entry being commented on.


Evaluates the comment being posted in a variety of ways and an MT::Comment object is returned. If the comment request is rejected due to throttling, no object is returned and the Comment Pending blog template is displayed.


Returns an error message to the user using the Comment Error blog template.



Returns some JavaScript code that sets the 'commenter_name' variable based on the 'tk_commenter' cookie that is accessible to the comments CGI script.


Handles a commenter URL redirect, where the comment_id points to a MT::Comment object with a URL. The response redirects the user to that URL. The comment must be approved and published.

Note: This behavior has been deprecated in favor of using the 'nofollow' plugin.


Handles the sign-in process for a sign-in request handled by external such authentication APIs as TypeKey and OpenID.


Mode that handles posting of a new comment.


Mode for previewing a comment before posting.


Mode for displaying a dynamic view of comments for a particular entry.



Called as soon as a new comment has been received. The callback must return a boolean value. If the return value is false, the incoming comment data will be discarded and the app will output an error page about throttling. A CommentThrottleFilter callback has the following signature:

    sub comment_throttle_filter($cb, $app, $entry)

$app is the MT::App::Comments object, whose interface is documented in MT::App::Comments, and $entry is the entry on which the comment is to be placed.

Note that no comment object is passed, because it has not yet been built. As such, this callback can be used to tell the application to exit early from a comment attempt, before much processing takes place.

When more than one CommentThrottleFilter is installed, the data is discarded unless all callbacks return true.


Called once the comment object has been constructed, but before saving it. If any CommentFilter callback returns false, the comment will not be saved. The callback has the following signature:

    sub comment_filter($cb, $app, $comment)


Spam filtering (or "Junk" filtering in MT terminology) is handled using the MT::JunkFilter package and plugins that implement them. Please refer to that module for further documentation.


Please see the MT manpage for author, copyright, and license information.


Hey! The above document had some coding errors, which are explained below:

Around line 2117:

You forgot a '=back' before '=head1'

Around line 2127:

=back without =over