When I set the defaults for any type of control, it doesn’t show in the builder UI. I’ve tried this with checkbox, select, text, and color elements (oddly, it works for number controls). The only way I’ve been able to have any text show up is by setting the placeholder value, which is misleading.
Example text control
$this->controls['text'] = array(
'tab' => 'content',
'label' => esc_html__( 'Some text', 'me' ),
'type' => 'text',
'spellcheck' => true,
'inlineEditing' => true,
'default' => 'Here is your text...',
);
Example select
$this->controls['dateRange'] = array(
'tab' => 'content',
'label' => esc_html__( 'Date range', 'me' ),
'type' => 'select',
'inline' => true,
'multiple' => false,
'clearable' => true,
'options' => [
'1' => esc_html__( '1 Day', 'me' ),
'7' => esc_html__( '7 Days', 'me' ),
'15' => esc_html__( '15 Days', 'me' ),
],
'default' => '3',
'placeholder' => esc_html__( 'Select range', 'me' ),
);
Am I missing something or is this a bug?