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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | array ( 'title' => 'Field Select' , 'fields' => array ( array ( 'name' => 'email' , 'label' => esc_html__( 'Email Field' , 'sometextdomain' ), 'type' => 'field_select' , 'required' => true, 'tooltip' => '<h6>' . esc_html__( 'Email Field' , 'sometextdomain' ) . '</h6>' . 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:
