Gform merge tag list exclude

Description

Use this filter to exclude field types from the merge tag drop-downs that are displayed throughout the admin pages.

Usage

<?php
add_filter("gform_merge_tag_list_exclude", "exclude_hidden", 10, 3);
?>

Parameters

$excluded_fields
(array) Array to be filtered. Contains a list of field types that will be excluded from the merge tag drop down
$element_id
(string) HTML ID attribute of the merge tag drop-down.
$fields
(array of Field Object) Array containing all form fields

Examples

This example adds a message below the currency drop down.


<?php

add_filter("gform_merge_tag_list_exclude", "currency_message", 10, 3);
function currency_message($message){
    return "US Dollars is the only supported currency by this payment gateway.";
}
?>

Placement

This code should be placed in the functions.php file of your active theme.

Source Code

This filter is located in common.php

Search the Documentation