benecaster_episode_references_moved
Fires once when an episode moves to another show, after every reference the episode cites points at the new show’s reference library. $map says which item in the new show’s library each cited item became, so data you keep per reference library item (a tracked redirect, a link-health record) can follow the episode. It does not fire for an episode with no references, or for a move that was refused.
Each item the episode cited is a key exactly once. Its value is the item the episode now cites: an item the new show already had with the same label and URL (compared case-insensitively) is reused; otherwise one is created there. Two keys can share a value. When two items resolve to one, the episode can cite it only once, so Benecaster drops the second use, but both old items stay in the map pointing at the item they merged into. Treat a shared value as a merge, not an error.
The old show’s library is untouched. Its other episodes still cite the old items, so do not retire anything keyed to an old item because it appears here. Copy, don’t move.
It fires part-way through the move: notes, feed caches and benecaster_episode_move_after come after it. Use the map here, and do anything that needs the whole move finished on benecaster_episode_move_after. No benecaster_reference_library_item_* or benecaster_episode_references_updated action fires for the re-pointing, and an item created in the new show’s library is announced only through this map.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$episode_id |
int |
— | ID of the episode that moved |
$from_show_id |
int |
— | ID of the show the episode left |
$to_show_id |
int |
— | ID of the show the episode moved to |
$map |
array |
— | [ old reference library item ID => new reference library item ID ]. Two keys may share a value |
Need this built rather than just documented? See our services →