DescriptionUsageParametersExamplesExample 1Example 2PlacementSource Code
Description
The 「gform_webhooks_post_request」 action fires after a Webhooks request has been executed and allows further actions to be performed.
Usage
The following would apply to all forms:
1add_action( 'gform_webhooks_post_request' 'your_function_name', 10, 4 );
To target a specific form, append the form id to the hook name. (format: gform_webhooks_post_request_FORMID)
1add_action( 'gform_webhooks_post_request_78' 'your_function_name', 10, 4 );
To target a specific form』s feed, append the form id and feed id to the hook name. (format: gform_webhooks_post_request_FORMID_FEEDID)
1add_action( 'gform_webhooks_post_request_78_12' 'your_function_name', 10, 4 );
Parameters
$response WP_Error or array
The response from the request execution. The response will be the WP_Error object if the execution fails, otherwise an array.
$feed Feed Object
The feed object.
$entry Entry Object
The current entry.
$form Form Object
The form object.
Examples
Example 1
1234add_action( 'gform_webhooks_post_request', 'post_request', 10, 4 );function post_request( $response, $feed, $entry, $form ){ //do something grand here}
Example 2
12345add_action( 'gform_webhooks_post_request', function ( $response, $feed, $entry, $form ) { if ( is_wp_error( $response ) ) { // Do something here if the request failed. }}, 10, 4 );
Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in GF_Webhooks::process_feed() in gravityformswebhooks/class-gf-webhooks.php.