get_required_val( $args ); $name = $this->get_field_name( $args['name'] ); $default = ! Jet_Engine_Tools::is_empty( $args['default'] ) ? $args['default'] : false; $data_switch = ''; if ( $required ) { $required = 'required="required"'; } if ( ! empty( $args['switch_on_change'] ) ) { $data_switch = ' data-switch="1"'; } if ( ! empty( $args['field_options'] ) ) { echo '
'; foreach ( $args['field_options'] as $value => $option ) { $checked = ''; $calc = ''; if ( is_array( $option ) ) { $val = isset( $option['value'] ) ? $option['value'] : $value; $label = isset( $option['label'] ) ? $option['label'] : $val; } else { $val = $value; $label = $option; } if ( $default || '0' === $default ) { $checked = checked( $default, $val, false ); } if ( is_array( $option ) && isset( $option['calculate'] ) ) { $calc = ' data-calculate="' . $option['calculate'] . '"'; } $custom_template = false; if ( ! empty( $args['custom_item_template'] ) ) { $custom_template = $this->get_custom_template( $val, $args, $checked ); } ?>
'; }