gravityflowincomingwebhook_response_post_process

The gravityflowincomingwebhook_response_post_process filter allows the WP_REST_Response object to be modified after processing.

Parameters

Parameter Type Definition
$response WP_REST_Response The current response
$entry Array The current entry array.
$data Array The request data.
$request WP_REST_Request The entire request object.

Examples

Example 1 - Adding an entry ID to the response body

add_filter('gravityflowincomingwebhook_response_post_process', 'jo_incoming_webhook_response_example', 10, 4);
function jo_incoming_webhook_response_example( $response, $entry, $data, $request ) {
	if ( $entry['form_id'] == '96' ) {
		if ( ! is_wp_error( $response ) && isset( $response->data ) && is_array( $response->data ) ) {
			$response->data['entry_id'] = $entry['id'];
		}
	}

	return $response;
}

Placement

This code should be placed in the functions.php file of your active theme or in a custom functions plugin.