Skip to main content

benecaster_content_calendar_item_response

Filter Premium content-calendar

Filters each Content Calendar content item as the benecaster-content-calendar/v1 REST API answers with it. It is applied to every item the API sends. A return that is not an array is ignored.

Parameters

Name Type Default Description
$data array — The item as the API will send it
$item array — The item as stored, including `created_by`, `created_at` and `updated_at`

Returns: array

Example

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 );

Notes

The Calendar screen reads the keys the API sends: add keys of your own, and do not change or remove those. Both shapes are listed in Read and write a show's Content Calendar content items over REST. Walkthrough: Add to what the Content Calendar REST API answers for a content item.

Affects

  • Calendar screen
  • GET/POST benecaster-content-calendar/v1/shows/{show_id}/items
  • GET/PUT/PATCH benecaster-content-calendar/v1/shows/{show_id}/items/{id}

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