gform_custom_merge_tags

gform_custom_merge_tags

DescriptionUsageParametersExamplePlacementSinceSource Code

Description
Allows for the inclusion of custom merge tags wherever merge tag drop downs are generated.
Usage
add_filter( 'gform_custom_merge_tags', 'your_function_name', 10, 4 );

Parameters

$merge_tags array
The merge tags.

$form_id int
The ID of the current form.

$fields Field Object
A collection of field objects.

$element_id int
The ID of the input field.

Example
add_filter('gform_custom_merge_tags', 'custom_merge_tags', 10, 4);
function custom_merge_tags( $merge_tags, $form_id, $fields, $element_id ) {
$merge_tags[] = array('label' => 'Download Link', 'tag' => '{download_link}');
return $merge_tags;
}

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.6.2.
Source Code
This filter is located in:
GFCommon::get_merge_tags() in common.php
GFCommon::insert_calculation_variables() in common.php

发表回复

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