<form action="<?php echo admin_url('admin-post.php'); ?>" method="POST">
    <input type="hidden" name="action" value="salva_impostazioni_cap_media">
    <input type="hidden" name="reset" value="0">
    <div class="container-fluid mt-3">
        <h3>Rule Upload Media</h3>
        <hr>
        <?php foreach($ruoli as $r){ $nome_ruolo = rtrim((string) translate_user_role($r['name']),'e'); ?>
            <h5>
                <?php echo $nome_ruolo."i"; ?>
            </h5>

            <div class="row mb-3">
                <div class="col-12">
                <?php foreach(get_users(['role' => $r['name']]) as $u){  ?>
                    <input class="form-control" type="checkbox" name="utenti[]" value="<?php echo $u->ID; ?>" id="chk_u_<?php echo $u->ID; ?>" <?php echo user_can($u->ID,'syrus_theme_upload_files') ? "checked" : "" ;?> autocomplete="off">
                    <label class="form-check-label" for="chk_u_<?php echo $u->ID; ?>">
                        <?php echo $u->data->display_name." (".$u->user_email.")"; ?>
                    </label>
                    <br>
                <?php } ?>
                </div>
            </div>
        <?php } ?>

        <div class="row mb-3">
            <div class="col-12">
                <button class="btn btn-primary">Salva</button>
                <button type="button" class="btn btn-secondary" onclick="jQuery('input[name=reset]').val(1);jQuery('form').submit();">Reset</button>
            </div>
        </div>
    </div>

</form>