Description
The gravityflowincomingwebhook_route filter allows developers to modify the REST API route used for incoming webhooks in the Gravity Flow Incoming Webhook extension.
Usage
add_filter( 'gravityflowincomingwebhook_route', 'your_function_name', 10, 1 );
Parameters
| Parameter | Type | Details |
|---|---|---|
| $route | string | The default REST API route for the webhook. |
The default endpoint for the Incoming Webhook workflow step is http://site.test/wp-json/gf/v2/entries/802/workflow-hooks/?workflow-api-key=xxxxxxx&workflow-api-secret=xxxxxxxx
Examples
Change the webhook route to a custom endpoint.
add_filter( 'gravityflowincomingwebhook_route', 'sb_gravityflowincomingwebhook_route', 10, 1 );
function sb_gravityflowincomingwebhook_route( $route ) {
$new_route = str_replace('entries','requests', $route);
return $new_route;
}
Placement
This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.
See also the PHP section in this article: Where Do I Put This Code?
Source Code
This filter is located in gravityflowincomingwebhook/class-incoming-webhook.php