We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Here's how you can use a select field with pre-populated options within the registration of your Shortcode UI.
select
array( 'label' => 'Field Label', 'description' => 'Description shown below the field. HTML tags possible.', 'attr' => 'yourshortcodeattribute', 'type' => 'select', 'options' => array( 'value1' => 'Label 1', 'value2' => 'Label 2', 'value3' => 'Label 3', ), ),
If you're using select for number range, you can shorten the 'options' value:
'options'
array( 'label' => __( 'Number of Items', 'your-text-domain' ), 'attr' => 'items', 'type' => 'select', 'options' => array_combine( range( 1, 7 ), range( 1, 7 ) ), 'multiple' => false, ),
produces:
<select name="items" id="shortcode-ui-items-c300" placeholder=""> <option value="1" selected="">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> </select>
https://github.com/wp-shortcake/shortcake.wiki.git