Skip to main content

benecaster_outlinks_redirect_destination_sync_before

Action Premium outlinks

Fires immediately before a tracked link’s destination follows an edit to its Reference Library item’s URL, so that every published /go/ link for it sends visitors to the new URL.

$redirect is the tracked link as it was before the write, as the database returns it (string values: id, show_id, reference_id, slug, destination_url and the rest), so $redirect['destination_url'] is the old URL.

Nothing fires for an edit that leaves the URL as it was (a label or description change), for a new URL that is not http or https (the link keeps its last safe destination), for an item no tracked link follows, or when the link already points at the new URL.

It fires only where Outlinks is switched on for the item’s show and the licence is current. The destination is updated everywhere, including on a lapsed site or a show where Outlinks is switched off, but no hook fires there.

Parameters

Name Type Default Description
$redirect array — The tracked link before the write
$destination string — The new destination URL (`http` or `https`, cleaned)

Notes

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