benecaster_workbench_tiles
Declares the tiles Podcast Workflow’s Workbench can draw: what each tile is, independent of any episode. Add an entry keyed by the tile’s id (lowercase letters, digits, - and _, as sanitize_key() leaves them). An entry with no label or an unknown stage is dropped, never drawn broken. This is part of the tile contract that Benecaster’s own Chapters tile and the partner add-ons build against; it changes only with deprecation.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$tiles |
array |
— | Tiles keyed by id, each `[ 'label' => string (required, translated), 'stage' => 'pre-production'|'recording'|'post-production'|'publish' (required), 'priority' => int (default 10, lowest first within the stage; ties by id), 'default_on' => bool (default false; only true counts), 'add_on' => string (your entitlement slug when the tile shows your add-on's data, default ''), 'description' => string (one line for the Workflow settings tab, default '') ]` |
$show_id |
int |
— | The show whose tiles are being read |
Returns:
array
Example
add_filter( 'benecaster_workbench_tiles', function ( array $tiles, int $show_id ): array {
return $tiles + [
'chapter-markers' => [
'label' => __( 'Chapter markers', 'my-plugin' ),
'stage' => 'post-production',
'priority' => 40,
'default_on' => false,
],
];
}, 10, 2 );
Notes
Add with $tiles + [ … ] (or check isset()), never $tiles[ $id ] = …: a filter cannot stop a later callback overwriting a key, so between add-ons an id stays first-come only while each adds this way. Podcast Workflow's own eight tile ids (title, outline, recording-complete, show-notes, audio-video, artwork-metadata, availability, episode-status) are put back at the last priority, so they can never be replaced; they are declared at priority 5, so a callback at the default 10 sees them. default_on is only a default: a show's choice in its Workflow settings tab overrides it (Read or change which Workbench tiles a show draws, and run code when a show saves its choice). Walkthrough: Put a tile on the Podcast Workflow Workbench, and say where it stands for each episode.
Affects
- Workbench
- Workflow tab (show settings)
- GET benecaster-podcast-workflow/v1/shows/{show_id}/episodes
- GET benecaster-podcast-workflow/v1/shows/{show_id}/episodes/{episode_id}/workbench
- GET/PUT benecaster-podcast-workflow/v1/shows/{show_id}/workflow-settings
Need this built rather than just documented? See our services →