Replace the episode editor’s free guest rows with your own selector
The episode editor’s Guests tab lists guests as free Name and Website URL (optional) rows with an Add Guest button. A fill registered into the BenecasterEpisodeGuests slot is drawn in their place, inside a wrapper carrying data-tour="episode-guest-selector". Feed Credits below it stays Benecaster’s.
The fill receives:
episodeId: the episode, ornullon a new, unsaved one;showId: the episode’s own show;setDirty( bool ): turns the editor’s unsaved-changes prompt on and off. It asks only when the podcaster leaves the episode (another screen or episode, Back, switching show, a reload); the editor’s own tab switches, and its move to the saved episode after a new episode’s first save, pass without asking. The flag lasts as long as the editor, not the Guests tab, because your picks survive a tab switch.
Register the fill inside wp.domReady, with your script depending on benecaster-admin, so Benecaster’s runtime is published first — see inject-react-component-into-slot for the bundler setup.
Code
function MyGuestPicker( { episodeId, showId, setDirty } ) {
// Your own search-or-create UI; save through your own REST route.
return window.BenecasterExtensions.React.createElement(
'div',
null,
`Guests for episode ${ episodeId ?? '(new)' }`
);
}
window.wp.domReady( () => {
window.BenecasterExtensions?.registerFill?.( 'BenecasterEpisodeGuests', MyGuestPicker );
} );
Need this built rather than just documented? See our services →