Add to what the Content Calendar REST API answers for a content item
benecaster_content_calendar_item_response is a filter, ( array $data, array $item ): array. $data is the item as Read and write a show’s Content Calendar content items over REST describes it; $item is the stored item as Run your own code when a Content Calendar content item is saved or deleted describes it. It is applied to every item benecaster-content-calendar/v1 answers with. A return that is not an array is ignored.
The Calendar screen reads the keys the API sends: add keys of your own, and do not change or remove those.
Code
<?php
add_filter( 'benecaster_content_calendar_item_response', function ( array $data, array $item ): array {
$data['scheduler_status'] = my_social_scheduler_status_for( $item['id'] );
return $data;
}, 10, 2 );
Hooks Used
Need this built rather than just documented? See our services →