Skip to main content

benecaster_guest_manager_episode_guests

Filter Premium guest-manager

Filters an episode’s guests as other add-ons read them through benecaster_guest_manager_get_episode_guests(): the Email Editor, AI Search, Transcription, or your own code. Each entry is [ 'id' => int, 'name' => string, 'title' => string, 'organization' => string, 'website' => string, 'profile_url' => string ], in the episode’s order.

Runs only when Guest Manager is on for the episode’s own show, so nothing can add guests to a switched-off show’s episode.

Parameters

Name Type Default Description
$guests array — List of `[ id, name, title, organization, website, profile_url ]`; values are raw text
$episode_id int — The episode
$show_id int — The episode's show, with Guest Manager switched on

Returns: array

Example

// Leave out guests who have no title.
add_filter( 'benecaster_guest_manager_episode_guests', function ( array $guests, int $episode_id, int $show_id ): array {
    return array_values( array_filter( $guests, fn( array $g ): bool => '' !== $g['title'] ) );
}, 10, 3 );

Notes

A return that is not an array is ignored. Not called when the function returns [] for an id that is not an episode or a show where Guest Manager is off. Walkthrough: Read an episode's guests from another add-on.

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