gform_gf_field_create

gform_gf_field_create

DescriptionUsageParametersExamples1. Create GF_Field object based on 「type」 property (rather than 「inputType」 property)Source CodeSince

Description
Use this filter to modify or replace the GF_Field object after it has been created.
Usage
1add_filter( 'gform_gf_field_create', 'my_custom_function', 10, 2 );

Parameters

$field GF_Field
A GF_Field object of the type specified by the $properties['type'] or $properties['inputType'] properties.

$properties array
An array of field properties that will be used to generate the GF_Field object.

Examples
1. Create GF_Field object based on 「type」 property (rather than 「inputType」 property)
1234567add_filter( 'gform_gf_field_create', 'my_custom_function', 10, 2 );function my_custom_function( $field, $properties ) {    if( $field->type == 'myCustomFieldType' ) {        $field = new GF_My_Custom_Field_Type( $properties );    }    return $field;}
Source Code
This filter is located in GF_Fields::create() in includes/addon/class-gf-fields.php.
Since
This filter was added in Gravity Forms 2.0.

發表回覆

您的郵箱地址不會被公開。 必填項已用 * 標註