gform_ppcp_discount_total

gform_ppcp_discount_total

DescriptionUsageParametersExamplesLog the parametersPlacementSinceSource Code

Description

The gform_ppcp_discount_total JavaScript filter is used to override the discount amount that will be sent to PayPal Checkout.

Usage

The filter which runs for all would be used like so:

123gform.addFilter( 'gform_ppcp_discount_total', function( discountTotal, formId, total ) {    //do something}, 10, 3 );

Parameters

discountTotal float
The calculated positive discount total value.

formId int
The ID of the current form.

discountTotal float
The form total value.

Examples

Log the parameters

This example would log the contents of the three parameters to the browser console.

1234gform.addFilter( 'gform_ppcp_discount_total', function( discountTotal, formId, total ) {    console.log( arguments );    return discountTotal;}, 10, 3 );

Placement

This code should be placed in a theme custom JS file or a custom JS functions plugin.

Since

This filter was added in Gravity Forms PayPal Checkout Add-On v2.1.

Source Code

This filter is located in GFPPCP.getDiscountTotal() in /js/frontend.js.

gform_ppcp_disable_funding

gform_ppcp_disable_funding

DescriptionUsageParametersExamplePlacementSource Code

Description
This filter can be used to disable funding sources when using the PayPal Checkout method on the PayPal Field with the PayPal Checkout Add-On.
Usage
The following would apply to all forms:
add_filter( 'gform_ppcp_disable_funding', 'your_function_name' );

Parameters

$disabled_funding array
An array of disabled founding sources. Defaults to an empty array.
The possible values are: card, credit, venmo, sepa, bancontact, eps, giropay, ideal, mybank, p24, sofort.
See the PayPal Checkout developer documentation for the latest updates.

Example
This example shows how you can disable SEPA-Lastschrift as a funding source.
add_filter( 'gform_ppcp_disable_funding', 'ppcp_disable_sepa' );
function ppcp_disable_sepa( $disabled_funding ) {
$disabled_funding[] = 'sepa';
return $disabled_funding;
}

Placement
This code should be placed in the functions.php file of your active theme.
Source Code
return implode( ',', apply_filters( 'gform_ppcp_disable_funding', $disabled_funding ) )

This filter is located in GF_PPCP::get_disable_funding() in class-gf-ppcp.php.

gform_ppcp_card_style

gform_ppcp_card_style

DescriptionUsageParametersExamplePlacementSource Code

Description
The gform_ppcp_card_style filter can be used to customize the appearance of the credit card inputs for the PayPal Field which is available with the PayPal Checkout Add-On.
Usage
The following would apply to all forms:
add_filter( 'gform_ppcp_card_style', 'your_function_name', 10, 2 );

Parameters

$card_style array
An array of styles. See the PayPal API documentation for details about supported properties.
The default styles array is defined like so:
array(
'input' => array(
'font-size' => '1em',
),
':focus' => array(
'color' => 'black',
),
);

$form_id int
The ID of the form containing the PayPal Field being prepared for display.

Example
This example shows how you can change the font size.
add_filter( 'gform_ppcp_card_style', 'ppcp_card_style_font_size', 10, 2 );
function ppcp_card_style_font_size( $card_style, $form_id ) {
$card_style['input']['font-size'] = '1.5em';
return $card_style;
}

Placement
This code should be placed in the functions.php file of your active theme.
Source Code
$args['cardStyle'] = apply_filters( 'gform_ppcp_card_style', $card_style, $form['id'] );

This filter is located in GF_PPCP::register_init_scripts() in class-gf-ppcp.php.

gform_postmark_send_email_failed

gform_postmark_send_email_failed

DescriptionUsageParametersSinceSource Code

Description
Triggered when an email from Gravity Forms fails to be passed to Postmark.
Usage
add_action( 'gform_postmark_send_email_failed', 'my_function', 10, 6 );

Parameters

$error_message string
The error message.

$postmark_email array
The Postmark email arguments.

$email array
The original email details.

$message_format array
The message format, html or text.

$notification array
The Notification object.

$entry array
The current Entry object.

Since
This action hook was added in Postmark version 1.2.
Source Code
This action hook is located in GF_Postmark::maybe_send_email() in gravityformspostmark/class-gf-postmark.php.

gform_postimage_title

gform_postimage_title

DescriptionUsageParametersExamplesSource Code

Description
This filter is executed when creating the Post Image Title field and can be used to modify the 「Title」 label.
Usage
This would apply the function to all forms.
add_filter( 'gform_postimage_title', 'your_function_name', 10, 2 );

To target a specific form append the form id to the hook name. (format: gform_postimage_title_FORMID)
add_filter( 'gform_postimage_title_5', 'your_function_name', 10, 2 );

Parameters

$label string
The label to be filtered.

$form_id integer
The current form』s id.

Examples
This example changes the default Post Image Title label;
add_filter( 'gform_postimage_title', 'change_postimage_title', 10, 2 );
function change_postimage_title( $label, $form_id ) {
return 'Image Title';
}

Source Code
This filter is located in GF_Field_Post_Image::get_field_input() in includes/fields/class-gf-field-post-image.php.

gform_postimage_file

gform_postimage_file

DescriptionUsageParametersExamplesSource Code

Description
This filter is executed when creating the Post Image File field and can be used to modify the 「File」 label.
Usage
Applies to all forms.
1add_filter( 'gform_postimage_file', 'your_function_name', 10, 2 );
To target a specific form append the form id to the hook name. (format: gform_postimage_file_FORMID)
1add_filter( 'gform_postimage_file_5', 'your_function_name', 10, 2 );

Parameters

$label string
The label to be filtered.

$form_id integer
The current form』s id.

Examples
This example changes the default Post Image File label:
1234add_filter( 'gform_postimage_file', 'change_postimage_file', 10, 2 );function change_postimage_file( $label, $form_id ) {    return 'Image File';}
Source Code
This filter is located in GF_Field_Post_Image::get_field_input() in includes/fields/class-gf-field-post-image.php.

gform_postimage_description

gform_postimage_description

DescriptionUsageParametersExamplesSource Code

Description
This filter is executed when creating the Post Image Description field and can be used to modify the 「Description」 label.
Usage
This would apply your function to all forms.
1add_filter( 'gform_postimage_description', 'your_function_name', 10, 2 );
To target a specific form append the form id to the hook name. (format: gform_postimage_description_FORMID)
1add_filter( 'gform_postimage_description_5', 'your_function_name', 10, 2 );

Parameters

$label string
The label to be filtered.

$form_id integer
The current form』s id.

Examples
This example changes the default Post Image Description label:
1234add_filter( 'gform_postimage_description', 'change_postimage_description', 10, 2 );function change_postimage_description( $label, $form_id ) {    return 'Image Description';}
Source Code
This filter is located in GF_Field_Post_Image::get_field_input() in includes/fields/class-gf-field-post-image.php.

gform_postimage_caption

gform_postimage_caption

DescriptionUsageParametersExamplesSource Code

Description
This filter is executed when creating the Post Image Caption field and can be used to modify the 「Caption」 label.
Usage
The following would apply your function to all forms.
add_filter( 'gform_postimage_caption', 'your_function_name', 10, 2 );

To target a specific form append the form id to the hook name. (format: gform_postimage_caption_FORMID)
add_filter( 'gform_postimage_caption_5', 'your_function_name', 10, 2 );

Parameters

$label string
The label to be filtered.

$form_id integer
The current form』s id.

Examples
This example changes the default Post Image Caption label:
add_filter( 'gform_postimage_caption', 'change_postimage_caption', 10, 2 );
function change_postimage_caption( $label, $form_id ) {
return 'Image Caption';
}

Source Code
This filter is located in GF_Field_Post_Image::get_field_input() in includes/fields/class-gf-field-post-image.php.

gform_post_upgrade

gform_post_upgrade

DescriptionUsageParametersExamplesPlacementSource Code

Description
The 「gform_post_upgrade」 action hook in Gravity Forms fires after Gravity Forms has been fully upgraded, allowing further actions to be performed.
Usage
add_action( 'gform_post_upgrade', 'your_function_name', 10, 3 );

Parameters

$version string
The upgraded version of Gravity Forms.

$from_db_version string
The version before the upgrade.

$force_upgrade bool
True/false indicating if the upgrade were forced.

Examples
add_action( 'gform_post_upgrade', 'alert_upgrade', 10, 3 );
function alert_upgrade( $version, $from_db_version, $force_upgrade ){
echo 'Gravity Forms was upgraded from ' . $from_db_version . ' to ' . $version;
}

Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in GFUpgrade::set_upgrade_ended() in class-gf-upgrade.php.

gform_post_update_form_meta

gform_post_update_form_meta

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description
Fires after form meta has been updated for any form.
Usage
The following would apply to all forms:
add_action( 'gform_post_update_form_meta', 'your_function_name', 10, 3 );

To target a specific form, append the form id to the hook name. (format: gform_post_update_form_meta_FORMID):
add_action( 'gform_post_update_form_meta_1', 'your_function_name', 10, 3 );

Parameters

$form_meta Form Object
The current form data.

$form_id int
The form id.

$meta_name string
The name of the meta updated.

Examples
add_action( 'gform_post_update_form_meta', 'update_data', 10, 3 );
function update_data( $form_meta, $form_id, $meta_name ){
GFCommon::send_email( '[email protected]', '[email protected]','','','Form ' . $form_id, 'Form Updated at ' . date('Y-m-d H:i:s' ) );
}

Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms version 1.9.
Source Code
This filter is located in GFFormsModel::update_form_meta() in forms_model.php.