benecaster_outlinks_redirect_move_copy_after
Fires once for each tracked link Outlinks has copied when an episode moved to another show, once the copy is complete: the new link created, with a free name (usually {old-name}-2), and its settings and country rules saved.
It fires only where Outlinks is switched on for the destination show and the licence is current; whether Outlinks is on for the old show does not matter.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$source_redirect_id |
int |
— | ID of the tracked link that was copied, in the old show |
$new_redirect_id |
int |
— | ID of the new tracked link, in the destination show |
$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 |
Examples
Log each copied link
add_action( 'benecaster_outlinks_redirect_move_copy_after', function ( int $source_id, int $new_id, int $episode_id, int $from_show_id, int $to_show_id ): void {
error_log( sprintf( 'Episode %d moved to show %d: redirect %d copied as %d', $episode_id, $to_show_id, $source_id, $new_id ) );
}, 10, 5 );
Notes
A copy that fails fires benecaster_outlinks_redirect_move_copy_before with no after. Walkthrough: Run your own code when moving an episode copies its tracked links.
Need this built rather than just documented? See our services →