Skip to main content

benecaster_outlinks_redirect_detach_after

Action Premium outlinks

Fires once a tracked link has been detached from a deleted Reference Library item, and only when the link was actually updated. The link stays live as a standalone link, with its clicks and its destination.

$redirect is the tracked link as it was before the write, so $redirect['reference_id'] still holds the deleted item’s id.

It fires only where Outlinks is switched on for the item’s show and the licence is current.

Parameters

Name Type Default Description
$redirect array — The tracked link before the write

Examples

Log links left without a library item

add_action( 'benecaster_outlinks_redirect_detach_after', function ( array $redirect ): void {
    error_log( sprintf( '/go/%s is now a standalone link (library item %d was deleted)', $redirect['slug'], (int) $redirect['reference_id'] ) );
} );

Notes

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