benecaster_guest_manager_after_change_episode_guests
Fires after an episode’s guests were linked, unlinked or reordered with the guest selector on the episode editor’s Guests tab (or through the benecaster-guest-manager/v1/episodes/{id}/guests routes), once the write is done: the episode note is written and the show’s feed refreshed. Not fired for a refused request or one that wrote nothing.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$episode_id |
int |
— | The episode |
$change |
string |
— | `link`, `unlink` or `reorder` |
$guest_ids |
array |
— | For `link`, the guests actually linked; for `unlink`, the one guest; for `reorder`, the new order |
Example
// Keep a "featuring" line in your own episode meta.
add_action( 'benecaster_guest_manager_after_change_episode_guests', function ( int $episode_id ): void {
$names = array_column( benecaster_guest_manager_get_episode_guests( $episode_id ), 'name' );
update_post_meta( $episode_id, '_my_featuring', implode( ', ', $names ) );
} );
Notes
Import Existing Guests does not fire it; it has its own pair. Walkthrough: Link, unlink or reorder an episode's guests from code, as the episode editor's selector does.
Affects
- Episode editor → Guests
Need this built rather than just documented? See our services →