Field Select Field

Field Select Field

IntroductionExampleUses

Introduction
The field_select type field, part of the Settings API, allows the user to select a form field from a drop down.
Example
The following example shows a section with a field_select type field which has been limited to only include email type form fields.
array(
'title' => esc_html__( 'This is the title for Section 1', 'sometextdomain' ),
'fields' => array(
array(
'name' => 'email',
'label' => esc_html__( 'Email Field', 'sometextdomain' ),
'type' => 'field_select',
'required' => true,
'tooltip' => '

' . esc_html__( 'Email Field', 'sometextdomain' ) . '

' . esc_html__( 'Select which Gravity Form field will be used as the subscriber email.', 'sometextdomain' ),
'args' => array(
'input_types' => array( 'email' )
)
),
),
),

The code above will render a drop down similar to the following:

Uses

settings_field_select()
get_form_fields_as_choices()
settings_select()

发表回复

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