Skip to main content

benecaster_settings_pages

Filter Free

Adds pages to the left navigation of the Benecaster Settings screen, below Account, Notifications, Email, Permalinks, Add-ons, Tools, Your Data and GDPR, in the order they were appended. That screen is install-wide, not per show.

A declared page is a nav entry and an empty slot. Benecaster renders no fields for it: fill the page’s BenecasterSettingsPage_{id} slot with a React component to give it content. The fill receives no props, because no show is in scope on this screen.

For a tab inside one show’s settings, use benecaster_show_settings_pages instead. Its fill receives { showId }. The two filters fill differently named slots, and a fill registered for the wrong one renders nothing and raises no error.

Every add-on page gets the same puzzle-piece icon in the navigation. An icon key in the declaration is accepted and returned by GET /admin/extensions, but nothing renders it.

Parameters

Name Type Default Description
$pages array — Array of page declaration arrays, each with keys: id, label, and optionally add_on

Returns: array

Examples

Register custom Integrations page

add_filter( 'benecaster_settings_pages', function( $pages ) {
    // Register a new "Integrations" page on the Benecaster Settings screen.
    $pages[] = [
        'id'    => 'integrations',
        'label' => 'Integrations',
    ];
    return $pages;
} );

Register add-on page with nav badge

add_filter( 'benecaster_settings_pages', function ( array $pages ): array {
    $pages[] = [
        'id'     => 'my-addon',
        'label'  => __( 'My Add-on', 'my-addon' ),
        'add_on' => 'my-addon',
    ];
    return $pages;
} );

Notes

The id value is used as both the React key and the SlotFill slot name (BenecasterSettingsPage_{id}). Without a fill the page opens empty.

Affects

  • Benecaster Settings navigation

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