<?php
$name = $args["name"];
$label = $args["label"];
$class = isset($args["class"]) ? $args["class"] : "";
$checked = isset($args["checked"]) ? $args["checked"] : false;
$required = isset($args["required"]) ? $args["required"] : false;
$data = isset($args["data"]) ? $args["data"] : null;
$data_str = $data ? wc_implode_html_attributes($data) : "";
?>

<div class="checkbox <?= $class ?>" <?= $data_str ?>>
  <input id="<?= $name ?>-checkbox" name="<?= $name ?>" type="checkbox" <?= $required ? "required" : "" ?> value="1"
    <?php checked($checked); ?> />
  <label for="<?= $name ?>-checkbox">
    <span><?= $label ?></span>
  </label>
</div>