gform_field_type_title

gform_field_type_title

DescriptionUsageParametersExamplesPlacementSource Code

Description
When adding a new field type, use this filter to assign a title to the new type.
Usage
1add_filter( 'gform_field_type_title','assign_title', 10, 2 );
Parameters

$title string
Title to be filtered. Defaults to the field type.

$field_type string
Field type.

Examples
This example assigns a title to a new custom field type.
12345678add_filter( 'gform_field_type_title', 'assign_title', 10, 2 );function assign_title( $title, $field_type ) {    if ( $field_type == 'map' ) {        return 'Map';    } else {        return $title;    }}
Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in GFCommon::get_field_type_title() in common.php

发表回复

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