Skip to main content

benecaster_availability_datetimes

Filter Free

Filters the tier-slug-to-datetime map before episode availability rows are written. Return the array — a tier_slug => 'Y-m-d H:i:s' map. Add, remove or re-time any entry.

The datetimes here are SITE-LOCAL, not UTC. AvailabilityRepository::upsert() converts once on the way into the database, so returning a UTC value shifts every affected episode by the site’s offset, silently and in the wrong direction. This is the one rule to get right in a callback here.

Follower rows are stripped AFTER this filter runs, deliberately — adding a follower entry here will not survive, because followers are a marketing list with a feed URL rather than a tier. Returning an empty array writes no rows at all rather than restoring defaults.

Parameters

Name Type Default Description
$tier_datetimes array — tier_slug => 'Y-m-d H:i:s' map, in the site's local timezone.
$episode_id int — Episode whose availability is being set.
$show_id int — Show the episode belongs to.

Returns: array

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