benecaster_content_calendar_content_types
Filters a show’s list of Content Calendar content types on every read of it: the Content Types panel, the item editor, type labels and colors, and the check that leaves switched-off types out of the calendar. A return that is not an array is ignored.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$types |
array |
— | The show's types in order, each `{ key, name, color, enabled, built_in, uses_content, content_limit }`, every built-in type present |
$show_id |
int |
— | The show whose list is being read |
Returns:
array
Example
add_filter( 'benecaster_content_calendar_content_types', function ( array $types, int $show_id ): array {
if ( ! in_array( 'custom_podcast_clip', array_column( $types, 'key' ), true ) ) {
$types[] = [ 'key' => 'custom_podcast_clip', 'name' => 'Podcast Clip', 'color' => '#db2777', 'enabled' => true, 'built_in' => false, 'uses_content' => true, 'content_limit' => 280 ];
}
return $types;
}, 10, 2 );
Notes
Built-in keys, on every show: tweet, truth, blog_post, newsletter, episode and other. A podcaster's own type has a custom_… key. Walkthrough: Read or change a show's Content Calendar content types.
Affects
- Calendar screen
- Content Types panel
- GET benecaster-content-calendar/v1/shows/{show_id}/types
Need this built rather than just documented? See our services →