Use a filter when several parts of your application may adjust the same value. Register callbacks with addFilter(), pass the starting value to applyFilters(), and use the returned value.
A useful example is a display title that different integrations can localize or annotate.
The first callback receives 'Release notes' as $title and 'en' as $locale. A later callback receives the first callback’s returned string as its new $title.
Lower priorities run first. Equal-priority filters keep registration order. The default is 10; choose another priority when the order is part of your hook point’s contract.
With no listeners, applyFilters() returns the original $value. Hooks does not transform or consume the additional arguments; it only passes them to registered callbacks.
The handle’s remove() method returns true once and false after removal. Callback-based removeFilter() matches the callback and priority. removeAllFilters(?string $hookPoint = null) removes filters for one point or, when omitted, all filter registrations.
Use actions when return values are irrelevant, and collectors when each listener should keep an independent result.