gform_field_standard_settings

gform_field_standard_settings

DescriptionUsageParametersExamplesPlacementSource Code

Description

Use this action to create new field settings under the Standard tab. Useful when implementing a new custom field type that requires custom settings.

Usage

add_action( 'gform_field_standard_settings', 'my_standard_settings', 10, 2 );

Parameters

$index integerSpecify the position that the settings should be displayed. For a list of all available positions, search form_detail.php for 「gform_field_standard_settings」 or review the Common Field Settings article.$form_id integerThe ID of the form from which the entry value was submitted.

Examples

This example creates a new standard setting for Single Line Text fields on the field』s General tab at position 25 (right after the Field Label setting), that specifies if the field data should be encrypted.

add_action( 'gform_field_standard_settings', 'my_standard_settings', 10, 2 );
function my_standard_settings( $position, $form_id ) {

//create settings on position 25 (right after Field Label)
if ( $position == 25 ) {
?>




  • Encryption

    Check this box to encrypt this field's data";
    return $tooltips;
    }

    Placement

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

    Source Code

    This filter is located in form_detail.php.

    发表回复

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