Skip to main content

benecaster_integration_action_result

Filter Free

Filters the array an integration action’s handler returned, before it is sent to the caller as result and stored to answer a repeat of the same idempotency key. Runs only when the handler succeeded — never for a WP_Error, and never for a replay. Actions are registered with benecaster_register_integration_action().

Parameters

Name Type Default Description
$result array — The handler's result
$action string — The action name, `{addon-slug}.{noun}.{verb}`
$show_id int — The show the caller named
$user_id int — The calling user

Returns: array

Examples

Add the site's own reference to every result

add_filter( 'benecaster_integration_action_result', function ( array $result, string $action, int $show_id, int $user_id ): array {
    $result['site'] = wp_parse_url( home_url(), PHP_URL_HOST );
    return $result;
}, 10, 4 );

Notes

Keep it JSON-serialisable: a result that cannot be encoded is answered 500 benecaster_action_failed instead. Return ids, not personal data — the first response is stored for 24 hours.

Affects

  • POST /benecaster/v1/actions REST endpoint

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