print_render_attribute_string( 'select-wrapper' . $i ); ?>>
'eicons',
'value' => 'eicon-caret-down',
'position' => 'right',
];
Icons_Manager::render_icon( $icon, [ 'aria-hidden' => 'true' ] );
}
?>
';
foreach ( $options as $key => $option ) {
$element_id = esc_attr( $item['custom_id'] ) . $key;
$html_id = $this->get_attribute_id( $item ) . '-' . $key;
$option_label = $option;
$option_value = $option;
if ( false !== strpos( $option, '|' ) ) {
list( $option_label, $option_value ) = explode( '|', $option );
}
$this->add_render_attribute(
$element_id,
[
'type' => $type,
'value' => $option_value,
'id' => $html_id,
'name' => $this->get_attribute_name( $item ) . ( ( 'checkbox' === $type && count( $options ) > 1 ) ? '[]' : '' ),
]
);
if ( ! empty( $item['field_value'] ) && $option_value === $item['field_value'] ) {
$this->add_render_attribute( $element_id, 'checked', 'checked' );
}
if ( $item['required'] && 'radio' === $type ) {
$this->add_required_attribute( $element_id );
}
$html .= '