Nuxy
Search…
29. Multiselect
1
'multiselect' => array(
2
'type' => 'multiselect',
3
'label' => esc_html__( 'Multiselect', 'my-domain' ),
4
'options' => array(
5
array(
6
'label' => 'My super title 1',
7
//You can add any data you need to save as key => value
8
),
9
array(
10
'label' => 'My super title 2',
11
),
12
)
13
),
Copied!
If you have same elements in one list of options, you have to add unique selector and specify it in config under key track_by
1
'multiselect_2' => array(
2
'type' => 'multiselect',
3
'label' => esc_html__( 'Multiselect', 'my-domain' ),
4
'options' => array(
5
array(
6
'label' => 'My super title 1',
7
'value' => '1'
8
),
9
array(
10
'label' => 'My super title 1',
11
'value' => '2'
12
),
13
),
14
'track_by' => 'value'
15
),
Copied!
Last modified 9mo ago
Copy link