Not a developer? Go to MovableType.com

Documentation

postdeletearchive_file

This callback is invoked just after to an archive file, a file that is generated by the combination of an Archive template and an Archive Map, is deleted.

Input Parameters

  • $cb - a reference to the current MT::Callback object handling this event.
  • $path - the absolute path on the local file system to the file being removed.
  • $type - the archive type of the file being published, usually one of ‘Index’, ‘Individual’, ‘Category’, ‘Daily’, ‘Monthly’, or ‘Weekly’.
  • $entry - The entry object, if in reference to an individual archive. Undefined otherwise.

Return Value

None.

Example Handler

sub handler {
    my ($cb, $path, $type, $entry) = @_;
    # do something
}

rebuild_options

This callback provides control over an array of additional custom rebuild options that are displayed in MT’s rebuild window.

Input Parameters

  • $cb - a reference to the current MT::Callback object handling this event.
  • $app - A reference to the MT::App instance processing the rebuild request.
  • $options - An array of hash references, for which each hash contains the following keys:
    • code - The code to execute when running the custom rebuild option.
    • label - The label to display in the list of rebuild options.
    • key - An identifier unique to this option (optional, will derive from the label if unavailable).

The options input parameter is used to populate the pull down menu that appears in the Movable Type publishing pop-up.

Return Value

None.

Example Handler

sub add_rebuild_options {
    my ($cb, $app, $options) = @_;
    push @$options, {
        code => \&rebuild_by_author,
        label => "Rebuild My Entries",
        key => "rebuild_by_author",
    }
}
Back

Leave a Comment