select

This option displays a select input and it has the following properties:

NameTypeDefaultDescription
optionsArray
The property allows multiple number types. Example:
[
   [
     'id'   => 'option_id',
     'name' => esc_html__( 'Option', 'zionbuilder' ),
    ],  
]
defaultStringThe property adds the default value:
'default'     => 'option_id',

Below is the following example of how the option can be used:

$options->add_option(
            'option_name',
            [
                'type'             => 'select',
                'description'      => esc_html__( 'Select the desired', 'zionbuilder' ),
                'title'            => esc_html__( 'Title', 'zionbuilder' ),
                'default'          => 'option_id_1',
                'options'          => [
                    [
                        'id'   => 'option_id_1',
                        'name' => esc_html__( 'Option 1', 'zionbuilder' ),
                    ],
                    [
                        'id'   => 'option_id_2',
                        'name' => esc_html__( 'Option 2', 'zionbuilder' ),
                    ],                    
            ]
        );

Was this article helpful ?

46 people consider this article helpful
Thank you! We will improve this article.

Didn’t find what you’re looking for? Please let us know

Submit a ticket