Craft has all kinds of events you can use to customize how things work. See Using Events in a Custom Module (opens new window) for an example of how to wire up event code using a module.
# Event Code Generator
Select an event for more detail and a code snippet.
# Common Event Flows
# Saving Entries
While every element in Craft CMS has a common set of events your custom code can subscribe to, the entry-saving workflow is one of the most common and complex.
See Handling Entry Saves (opens new window) for more on entry-specific concepts.
Generally, entries progress through the following order of operations:
- Pre-flight checks that trigger
- Validation that triggers
- Saving for the initial site that triggers
- Propagating non-translatable changes to the entry’s other sites, which repeats steps 1-3 for each site before triggering