Skip to main content

benecaster_badge_definition_updated

Action Premium

Fires after an existing badge definition is saved with new values. The change is already stored by the time your listener runs.

You receive both the updated badge and $previous, the badge exactly as it stood beforehand. Compare the two to react only to changes you care about — a label rename, an icon swap, a color change, the Keep after cancellation switch — without having to keep your own copy of the previous state between saves. Use for mirroring badge changes into an external system, refreshing a cache, or regenerating badge artwork when the icon changes.

Benecaster listens to this action itself: when the Keep after cancellation switch changes, it re-checks every member holding the badge.

Parameters

Name Type Default Description
$id int — Badge definition ID
$badge array — The updated badge row, including `keep_after_cancellation` (bool)
$previous array — The row as it stood immediately before the update, including `keep_after_cancellation` (bool)

Need this built rather than just documented? See our services →