gform_review_page

gform_review_page

DescriptionUsageParametersExamplesExample 1Example 2PlacementSource Code

Description
This filter is executed before the form is displayed and can be used to insert a review page before the final form submission.
Usage
The following would apply to all forms.
add_filter( 'gform_review_page', 'your_function_name' );

To limit the scope of your function to a specific form, append the form id to the end of the hook name. (format: gform_review_page_FORMID)
add_filter( 'gform_review_page_6', 'your_function_name' );

Parameters

$review_page array
The review page to be created.
array(
'content' => '',
'cssClass' => '',
'is_enabled' => false,
'nextButton' => array(
'type' => 'text',
'text' => __( 'Review Form', 'gravityforms' ),
'imageUrl' => '',
'imageAlt' => '',
),
'previousButton' => array(
'type' => 'text',
'text' => __( 'Previous', 'gravityforms' ),
'imageUrl' => '',
'imageAlt' => '',
),
);

$form Form Object
The current form.

$entry bool|Entry Object
False or the current entry.

Examples
Example 1
This example enables the review page and populates it with the {all_fields} merge tag.
add_filter( 'gform_review_page', 'add_review_page', 10, 3 );
function add_review_page( $review_page, $form, $entry ) {

// Enable the review page
$review_page['is_enabled'] = true;

if ( $entry ) {
// Populate the review page.
$review_page['content'] = GFCommon::replace_variables( '{all_fields}', $form, $entry );
}

return $review_page;
}

Example 2
This example changes the text of the 「Review Form」 button.
// NOTE: Update the '221' to the ID of your form.
add_filter( 'gform_review_page_222', 'change_review_page_button', 10, 3 );
function change_review_page_button( $review_page, $form, $entry ) {

$review_page['nextButton']['text'] = 'Review & Submit';

return $review_page;
}

Placement
This code should be placed in the functions.php file of your active theme.
Source Code
gf_apply_filters( 'gform_review_page', $form['id'], $review_page, $form, $partial_entry );
This filter is located in GFFormDisplay::maybe_add_review_page() in form_display.php

gform_rest_api_retrieve_form_totals

gform_rest_api_retrieve_form_totals

DescriptionUsageParametersExamples1. Simple Usage2. Advanced UsagePlacementSinceSource Code

Description
The gform_rest_api_retrieve_form_totals filter allows the entries property (entry totals) to be omitted from the GET /forms (REST API v2) response. This is useful for increasing performance of the endpoint when totals aren』t required.
Usage
The filter would be used like so:
add_filter( 'gform_rest_api_retrieve_form_totals', 'your_function_name', 10, 2 );

You can also specify this per form by adding the form id after the filter name.
add_filter( 'gform_rest_api_retrieve_form_totals_6', 'your_function_name', 10, 2 );

Parameters

$include_totals boolean
Whether to include totals; defaults to true.

$form object
The current form properties (id, title, date_created, is_active).

Examples
1. Simple Usage
add_filter( 'gform_rest_api_retrieve_form_totals', '__return_false' );

2. Advanced Usage
add_filter( 'gform_rest_api_retrieve_form_totals', function ( $include_totals, $form ) {
return ! in_array( $form->id, array( 1, 3, 5 ) );
}, 10, 2 );

Placement
This code should be placed in the functions.php file of your active theme or a custom functions plugin.
Since
This filter was added in Gravity Forms v2.4.24.1.
Source Code
This filter is located in GF_REST_Forms_Controller::get_items in includes/webapi/v2/includes/controllers/class-controller-forms.php.

gform_rest_api_capability_put_forms

gform_rest_api_capability_put_forms

DescriptionUsageParametersExamplePlacementSinceSource Code

Description
Filters the capability required to update forms via the Rest API V2.
Usage
add_filter( 'gform_rest_api_capability_put_forms', 'your_function_name', 10, 2 );

Parameters

$capability string
The capability required. Defaults to 『gravityforms_create_form』.

$request WP_REST_Request
Full data about the request.

Example
add_filter( 'gform_rest_api_capability_put_forms', 'get_put_forms_capability', 10, 2 );
function get_put_forms_capability ( $capability, $request )
{
return 'my_custom_capability';
}

Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms 2.4.
Source Code
This filter is located in GF_REST_Forms_Controller::update_item_permissions_check() in includes/webapi/v2/includes/controllers/class-controller-forms.php.

gform_rest_api_capability_put_feeds

gform_rest_api_capability_put_feeds

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description
Filters the capability required to update feeds via the Rest API V2.
Usage
add_filter( 'gform_rest_api_capability_put_feeds', 'your_function_name', 10, 2 );

Parameters

$capability string
The capability required. Defaults to 『gravityforms_edit_forms』.

$request WP_REST_Request
Full data about the request.

Examples
add_filter( 'gform_rest_api_capability_put_feeds', 'get_rest_api_capability_put_feeds', 10, 2 );

function get_rest_api_capability_put_feeds( $capability, $request )
{
return 'my_custom_capability';
}

Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms 2.4.
Source Code
This filter is located in GF_REST_Feeds_Controller::update_item_permissions_check() in includes/webapi/v2/includes/controllers/class-controller-feeds.php.

gform_rest_api_capability_put_entries

gform_rest_api_capability_put_entries

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description
Filters the capability required to update entries via the Rest API V2.
Usage
add_filter( 'gform_rest_api_capability_put_entries', 'your_function_name', 10, 2 );

Parameters

$capability string
The capability required. Defaults to 『gravityforms_edit_entries』.

$request WP_REST_Request
Full data about the request.

Examples
add_filter( 'gform_rest_api_capability_put_entries', 'get_put_entries_capability', 10, 2 );
function get_put_entries_capability ( $capability, $request )
{
return 'my_custom_capability';
}

Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms 2.4.
Source Code
This filter is located in:

GF_REST_Entries_Controller::update_item_permissions_check() in includes/webapi/v2/includes/controllers/class-controller-entries.php
GF_REST_Entry_Properties_Controller::update_item_permissions_check() in includes/webapi/v2/includes/controllers/class-controller-entry-properties.php

gform_rest_api_capability_post_forms

gform_rest_api_capability_post_forms

DescriptionUsageParametersExamplePlacementSinceSource Code

Description
Filters the capability required to create forms via the Rest API V2.
Usage
1add_filter( 'gform_rest_api_capability_post_forms', 'your_function_name', 10, 2 );

Parameters

$capability string
The capability required. Defaults to 『gravityforms_create_form』.

$request WP_REST_Request
Full data about the request.

Example
12345add_filter( 'gform_rest_api_capability_post_forms', 'get_post_forms_capability', 10, 2 );function get_post_forms_capability( $capability, $request ) {   return 'my_custom_capability'; }
Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms 2.4.
Source Code
This filter is located in GF_REST_Forms_Controller::create_item_permissions_check() in includes/webapi/v2/includes/controllers/class-controller-forms.php.

gform_rest_api_capability_post_feeds

gform_rest_api_capability_post_feeds

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description
Filters the capability required to create feeds via the Rest API V2.
Usage
add_filter( 'gform_rest_api_capability_post_feeds', 'your_function_name', 10, 2 );

Parameters

$capability string
The capability required. Defaults to 『gravityforms_edit_forms』.

$request WP_REST_Request
Full data about the request.

Examples
add_filter( 'gform_rest_api_capability_post_feeds', 'get_rest_api_capability_post_feeds', 10, 2 );

function get_rest_api_capability_post_feeds( $capability, $request )
{
return 'my_custom_capability';
}

Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms 2.4.
Source Code
This filter is located in:

GF_REST_Feeds_Controller::create_item_permissions_check() in includes/webapi/v2/includes/controllers/class-controller-feeds.php
GF_REST_Form_Feeds_Controller::create_item_permissions_check() in includes/webapi/v2/includes/controllers/class-controller-form-feeds.php

gform_rest_api_capability_post_entries

gform_rest_api_capability_post_entries

DescriptionUsageParametersExamplePlacementSinceSource Code

Description
Filters the capability required to create entries via the Rest API V2.
Usage
1add_filter( 'gform_rest_api_capability_post_entries', 'your_function_name', 10, 2 );

Parameters

$capability string
The capability required. Defaults to 『gravityforms_edit_entries』.

$request WP_REST_Request
Full data about the request.

Example
12345add_filter( 'gform_rest_api_capability_post_entries', 'get_post_entries_capability', 10, 2 );function get_post_entries_capability ( $capability, $request ) {   return 'my_custom_capability'; }
Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms 2.4.
Source Code
This filter is located in:

GF_REST_Entries_Controller::create_item_permissions_check in includes/webapi/v2/includes/controllers/class-controller-entries.php
GF_REST_Form_Entries_Controller::create_item_permissions_check in includes/webapi/v2/includes/controllers/class-controller-form-entries.php

gform_rest_api_capability_post_entries_notifications

gform_rest_api_capability_post_entries_notifications

DescriptionUsageParametersExamplePlacementSinceSource Code

Description
Filters the capability required to re-send notifications via the Rest API V2.
Usage
add_filter( 'gform_rest_api_capability_post_entries_notifications', 'your_function_name', 10, 2 );

Parameters

$capability string
The capability required. Defaults to 『gravityforms_edit_entries』.

$request WP_REST_Request
Full data about the request.

Example
add_filter( 'gform_rest_api_capability_post_entries_notifications', 'get_post_entries_notifications_capability', 10, 2 );
function get_post_entries_notifications_capability( $capability, $request )
{
return 'my_custom_capability';
}

Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms 2.4.
Source Code
This filter is located in GF_REST_Entry_Notifications_Controller::create_item_permissions_check in includes/webapi/v2/includes/controllers/class-controller-entry-notifications.php.

gform_rest_api_capability_get_results

gform_rest_api_capability_get_results

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description
Filters the capability required to get form results via the Rest API V2.
Usage
add_filter( 'gform_rest_api_capability_get_results', 'your_function_name', 10, 2 );

Parameters

$capability string
The capability required. Defaults to 『gravityforms_view_entries』.

$request WP_REST_Request
Full data about the request.

Examples
add_filter( 'gform_rest_api_capability_get_results', 'get_rest_api_capability_get_results', 10, 2 );

function get_rest_api_capability_get_results( $capability, $request )
{
return 'my_custom_capability';
}

Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms 2.4.
Source Code
This filter is located in GF_REST_Form_Results_Controller::get_items_permissions_check() in includes/webapi/v2/includes/controllers/class-controller-form-results.php.