Skip to main content

benecaster_guest_manager_guest_section_output

Filter Premium guest-manager

Filters the HTML of the benecaster_guest_section shortcode: an episode’s linked guests inside <div class="benecaster-guest-section">. $html is '' for an episode with no linked guest, or whose own show has Guest Manager off. Not called when Guest Manager is not running, or for an id that is not an episode or an episode the viewer may not see unpublished.

When the returned HTML is not empty, the episode page’s own Guests section steps aside for that episode, so the guests show once. Returning '' brings that section back.

Parameters

Name Type Default Description
$html string — The section's HTML
$episode_id int — The episode whose guests are drawn
$atts array — The shortcode's attributes after defaults: `episode_id`, `title`, `bio`, `photos`

Returns: string

Example

// Add a link to the guest directory under the section.
add_filter( 'benecaster_guest_manager_guest_section_output', function ( string $html, int $episode_id, array $atts ): string {
    return $html . '<p class="my-all-guests"><a href="' . esc_url( home_url( '/guests/' ) ) . '">All guests</a></p>';
}, 10, 3 );

Notes

The returned HTML is printed as is: escape anything you add. Walkthrough: Place guests anywhere with Guest Manager's shortcodes.

Affects

  • [benecaster_guest_section] shortcode

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