Description
The gform_webapi_authentication_required_$endpoint filter in Gravity Forms allows the overriding of authentication for all the endpoints of the Web API.
Usage
add_filter( 'gform_webapi_authentication_required_$endpoint', 'your_function_name' );
Parameters
| Parameter | Type | Description |
|---|---|---|
$authentication_required | bool | Whether authentication is required for this endpoint. |
Example
Force authentication for the POST forms/[ID]/submissions endpoint.
The following example forces the Gravity Forms Web API to authenticate the user before allowing the form to be POSTed.
add_filter( 'gform_webapi_authentication_required_post_forms_submissions', '__return_true' );
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 GFWebAPI::handle_page_request() in includes/webapi/webapi.php