diff --git a/inc/class-shortcode-ui.php b/inc/class-shortcode-ui.php index 60e2d60e..3d3bf459 100644 --- a/inc/class-shortcode-ui.php +++ b/inc/class-shortcode-ui.php @@ -47,6 +47,13 @@ public function register_shortcode_ui( $shortcode_tag, $args = array() ) { $args['attrs'] = array(); } + foreach ( $args['attrs'] as &$attr ) { + if ( 'select' === $attr['type'] && ! isset( $attr['value'] ) ) { + $_shortcodes = array_keys( $attr['options'] ); + $attr['value'] = array_shift( $_shortcodes ); + } + } + $args['shortcode_tag'] = $shortcode_tag; $this->shortcodes[ $shortcode_tag ] = $args;