Skip to main content

benecaster_episode_page_block_types

Filter Free

Registers block type definitions for the Episode Page settings panel. Each key in the $types array is a block slug; each value is a definition array with the following keys: label (string, shown in the settings panel), default (bool, whether enabled for new shows), position ('before' or 'after' the episode player), requires (add-on slug string or null), renderer (callable that returns HTML), and settings (callable that renders settings fields, or null).

Blocks whose requires value resolves to an inactive add-on appear as greyed rows in the Episode Page settings panel with an install link. Registered blocks appear automatically in the settings panel and are available to the benecaster_episode_page_blocks and benecaster_episode_page_block_{slug} filters. Built-in slugs that cannot be overridden: context_bar, share_buttons, episode_nav, related_episodes, social_links, platform_links, listener_support, subscribe_cta.

Parameters

Name Type Default Description
$types array Keyed array of block type definitions

Returns: array

Examples

Register custom transcript block

add_filter( 'benecaster_episode_page_block_types', function( $types ) {
    // Register a custom Transcript block for episodes with transcript data.
    $types['transcript'] = [
        'label'    => 'Transcript',
        'default'  => false,
        'position' => 'after',
        'requires' => null,
        'renderer' => 'my_plugin_render_transcript_block',
        'settings' => null,
    ];
    return $types;
} );

Register guests block with add-on requirement

add_filter( 'benecaster_episode_page_block_types', function( array $types ): array {
    $types['guests'] = [
        'label'    => 'Guests in this episode',
        'default'  => false,
        'position' => 'after',
        'requires' => 'addon:guest-manager',
        'renderer' => 'GuestManager\EpisodePageBlock::render',
        'settings' => 'GuestManager\EpisodePageBlock::settings_fields',
    ];
    return $types;
} );

Affects

  • Settings → Show → Episode Page panel
  • EpisodePageRenderer injection