<?php
defined('ABSPATH') or die('No script kiddies please!!');


if (!empty($field_details['options'])) {
    $values = $field_details['values'];
    if ($field_type == 'radio') {
        $checked = $field_details['checked'];
    }
    $i = 0;
    foreach ($field_details['options'] as $option) {


?>
        <div class="std-each-dropdown">
            <?php if ($field_type == 'radio') {
            ?>
                <label>
                    <input type="radio" name="<?php echo esc_attr($field_name_prefix); ?>[checked_radio]" class="std-checked-radio-ref" <?php checked($checked[$i], '1'); ?> /><?php esc_html_e('Checked', 'subscribe-to-download'); ?>
                    <input type="hidden" name="<?php echo esc_attr($field_name_prefix); ?>[checked][]" value="<?php echo intval($checked[$i]); ?>" class="std-checked-radio-val" />
                </label>
            <?php } ?>
            <input type="text" name="<?php echo esc_attr($field_name_prefix); ?>[options][]" placeholder="<?php esc_html_e('Option', 'subscribe-to-download'); ?>" value="<?php echo esc_attr($option); ?>" />
            <input type="text" name="<?php echo esc_attr($field_name_prefix); ?>[values][]" placeholder="<?php esc_html_e('Value', 'subscribe-to-download'); ?>" value="<?php echo esc_attr($values[$i]); ?>" />
            <span class="dashicons dashicons-trash std-delete-dropdown-trigger"></span>
        </div>
<?php
        $i++;
    }
}
?>