Skip to main content

Add to what the Content Calendar REST API answers for an idea

Premium Intermediate Content Calendar

benecaster_content_calendar_idea_response is a filter, ( array $data, array $idea ): array, on every idea the ideas routes answer with (see Read, write, rearrange and promote a show’s Content Calendar ideas over REST), including each one in a list or reorder answer. $data is what will be sent; $idea is the idea as stored, as Run your own code when a Content Calendar idea is saved, deleted or rearranged describes it. A return that is not an array is ignored.

Code

<?php
add_filter( 'benecaster_content_calendar_idea_response', function ( array $data, array $idea ): array {
    $data['author'] = get_the_author_meta( 'display_name', $idea['created_by'] );
    return $data;
}, 10, 2 );

View on GitHub →

Hooks Used

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