gform_aweber_field_value

gform_aweber_field_value

DescriptionUsageParametersExamples1. Change Signature ValuePlacementSource CodeSince

Description
This filter can be used to modify a value before it is sent to AWeber.
Usage
The base filter which would run for all forms and all fields would be used like so:
add_filter( 'gform_aweber_field_value', 'your_function_name', 10, 4 );

To target a specific form append the form id to the hook name. (format: gform_aweber_field_value_FORMID)
add_filter( 'gform_aweber_field_value_10', 'your_function_name', 10, 4 );

To target a specific field append both the form id and the field id to the hook name. (format: gform_aweber_field_value_FORMID_FIELDID)
add_filter( 'gform_aweber_field_value_10_3', 'your_function_name', 10, 4 );

Parameters

$value string
The value to be modified.

$form_id integer
The ID of the form being processed.

$field_id string
The ID of the field being processed.

$entry Entry Object
The entry currently being processed.

Examples
1. Change Signature Value
This example shows how you can send the url of the signature image.
add_filter( 'gform_aweber_field_value', 'change_signature_value', 10, 4 );
function change_signature_value( $value, $form_id, $field_id, $entry ) {
$form = GFAPI::get_form( $form_id );
$field = GFFormsModel::get_field( $form, $field_id );

if ( is_object( $field ) && $field->get_input_type() == 'signature' ) {
$value = RGFormsModel::get_upload_url_root() . 'signatures/' . $value;
}

return $value;
}

Placement
This code should be placed in the functions.php file of your active theme.
Source Code
gf_apply_filters( 'gform_aweber_field_value', array( $form['id'], $field_id ), $field_value, $form['id'], $field_id, $entry )

This filter is located in GFAWeber::maybe_override_field_value() in class-gf-aweber.php.
Since
The base filter was added in version 2.0. The form and field specific versions of this filter were added in version 2.3.

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注