Select2

The select field allows to display information in a dropdown field and multiselect format.

Field Parameters

Name Type Default Description
type string ‘select2’ Value identifies the field types.
multiple boolean false Allow select value from True or False.
id string Identifies unique ID for the field. It must be different from other existing field IDs.
title string Displays the field label.
desc string Describe the field option in details, appears underneath the field control.
required array Acts like boolean operator and provides the parent, comparison operation, and value which decides the field visibility.
value string or array When multiple is true, value would be array. When multiple is false value be string.
options array Options offers information in a dropdown field and multiselect format

Example Declaration:

array(
'id'      => 'type',
'title'   => esc_html__( 'Heading type', 'ultimate-page-builder' ),
'desc'  => wp_kses_post( __( 'Description', 'ultimate-page-builder' )),
'type'    => 'select2',
'value'   => 'h1',
'options' => array(
    'h1' => esc_html__( 'Heading 1', 'ultimate-page-builder' ),
    'h2' => esc_html__( 'Heading 2', 'ultimate-page-builder' ),
    'h3' => esc_html__( 'Heading 3', 'ultimate-page-builder' ),
    'h4' => esc_html__( 'Heading 4', 'ultimate-page-builder' ),
    'h5' => esc_html__( 'Heading 5', 'ultimate-page-builder' ),
    'h6' => esc_html__( 'Heading 6', 'ultimate-page-builder' ),
    )
);

If you have multiple select option then your default value should be array otherwise it can be string.

Options

  • multiple - create multiple select option. default is false

results matching ""

    No results matching ""