<?php
if ( ! defined( 'ABSPATH' ) ) exit;
/**
 * @var array  $field
 * @var mixed  $value
 * @var string $name_base
 */
$options = isset( $field['options'] ) && is_array( $field['options'] ) ? $field['options'] : array();
$current = is_scalar( $value ) ? (string) $value : '';
?>
<select id="cn-field-<?php echo esc_attr( $field['id'] ); ?>"
        name="<?php echo esc_attr( $name_base ); ?>"
        class="cn-input cn-input-select">
    <?php foreach ( $options as $val => $label ) : ?>
        <option value="<?php echo esc_attr( $val ); ?>"
            <?php selected( (string) $val, $current ); ?>>
            <?php echo esc_html( $label ); ?>
        </option>
    <?php endforeach; ?>
</select>
