public function generate_multiselect_html($key, $data)
{
$field_key = $this->get_field_key($key);
$defaults = array('title' => '', 'disabled' => false, 'class' => '', 'css' => '', 'placeholder' => '', 'type' => 'text', 'desc_tip' => false, 'description' => '', 'custom_attributes' => array(), 'select_buttons' => false, 'options' => array());
$data = wp_parse_args($data, $defaults);
$value = (array) $this->get_option($key, array());
ob_start();
?>
<tr valign="top">
<th scope="row" class="titledesc">
<label for="<?php
echo esc_attr($field_key);
?>
"><?php
echo wp_kses_post($data['title']);
?>
</label>
<?php
echo $this->get_tooltip_html($data);
?>
</th>
<td class="forminp">
<fieldset>
<legend class="screen-reader-text"><span><?php
echo wp_kses_post($data['title']);
?>
</span></legend>
<select multiple="multiple" class="multiselect <?php
echo esc_attr($data['class']);
?>
" name="<?php
echo esc_attr($field_key);
?>
[]" id="<?php
echo esc_attr($field_key);
?>
" style="<?php
echo esc_attr($data['css']);
?>
" <?php
disabled($data['disabled'], true);
?>
<?php
echo $this->get_custom_attribute_html($data);
?>
>
<?php
foreach ((array) $data['options'] as $option_key => $option_value) {
?>
<option value="<?php
echo esc_attr($option_key);
?>
" <?php
selected(in_array($option_key, $value), true);
?>
><?php
echo esc_attr($option_value);
?>
</option>
<?php
}
?>
</select>
<?php
echo $this->get_description_html($data);
?>
<?php
if ($data['select_buttons']) {
?>
<br/><a class="select_all button" href="#"><?php
_e('Select all', 'woocommerce');
?>
</a> <a class="select_none button" href="#"><?php
_e('Select none', 'woocommerce');
?>
</a>
<?php
}
?>
</fieldset>
</td>
</tr>
<?php
return ob_get_clean();
}