Skip to main content

Add a tab to the episode editor via PHP filter (Tier 1)

Free Intermediate Since v1.0.0

The simplest way to extend the episode editor. Declare a tab with sections and fields using a PHP array — no JavaScript required. The core React app fetches this config at boot and renders the tab automatically. Field values with meta: true are stored as episode post meta. Supported field types: text, textarea, select, toggle, number, url, post_select.

Code

<?php
add_filter( 'benecaster_episode_editor_tabs', function ( array $tabs ): array {
    $tabs[] = [
        'id'       => 'my-addon',
        'label'    => __( 'My Add-on', 'my-addon' ),
        'icon'     => 'puzzle',
        'add_on'   => 'my-addon',
        'sections' => [
            [
                'id'     => 'my-settings',
                'label'  => __( 'Settings', 'my-addon' ),
                'fields' => [
                    [
                        'id'      => '_my_addon_field',
                        'type'    => 'toggle',
                        'label'   => __( 'Enable feature', 'my-addon' ),
                        'default' => false,
                        'meta'    => true,
                    ],
                ],
            ],
        ],
    ];
    return $tabs;
} );

View on GitHub →

Hooks Used