Documentation

gform_field_type_title

  1. Description
  2. Usage
  3. Parameters
  4. Examples
  5. Placement
  6. Source Code


Description

When adding a new field type, use this filter to assign a title to the new type.


Usage

add_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.

add_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