There are type primary different types of events in Movable Type:
- Application-level Events
- Object-level Events
Application events occur at specific points during the life cycle of the Movable Type. Application callbacks include those that are fired during publishing, during backup and restore operations, in our Atom and XML-RPC APIs and more.
For a complete listing of Application Callbacks, consult the Movable Type Callbacks Reference.
Object-level events are automatically associated with every single object type in Movable Type and are fired just prior to and after that object is modified in the database. For example, all objects expose the following standard subroutines:
Events are fired for each of the above operations just prior and immediately following them being called by a developer. Developers can register callbacks for the following events, which hopefully will correlate logically to their corresponding events:
A couple of notes:
post_loadcallbacks are invoked for each object when a developer invokes the
load_itermethod on an object
no event is fired for
You will need to replace “MT::ObjectName” with the package name for the object in question. For example, the
pre_save event for the MT::Entry object is:
Note: Developers creating their own object types do not need to create or fire these events. That is handled for you by Movable Type’s data abstraction layer.