Skip to content

Instantly share code, notes, and snippets.

@camaleaun
Last active December 8, 2017 14:01
Show Gist options
  • Select an option

  • Save camaleaun/89bec699f3abfd8b65bee7d6d43a00e5 to your computer and use it in GitHub Desktop.

Select an option

Save camaleaun/89bec699f3abfd8b65bee7d6d43a00e5 to your computer and use it in GitHub Desktop.
<div class="budget">
<p>Solicite um orçamento</p>
<form class="form-pedido" id="form-pedido-add" method="post" action="<?php echo esc_attr( site_url() ); ?>/orcamento">
<?php wp_nonce_field( 'ac_nonce_produtos', 'nonce_produtos', true, true ); ?>
<input type="hidden" name="type_page_verify" value="produtos" />
<input type="hidden" name="prod" value="<?php the_ID(); ?>"/>
<?php
$cores = get_field( 'cores' );
if ( $cores ) {
?>
<div id="cores" class="btn-group" data-toggle="buttons">
<?php
$i = 0;
foreach ( $cores as $cor ) {
$i++;
$actived = ( reset( $cores ) === $cor ) ? ' active' : '';
$checked = ( reset( $cores ) === $cor ) ? ' checked' : '';
?>
<label class="btn btn-primary<?php echo esc_attr( $actived ); ?>">
<input type="checkbox" autocomplete="off"<?php echo esc_attr( $checked ); ?> name="color" value="color<?php echo esc_attr( $i ); ?>"> <span class="sr-only">Cor <?php echo esc_html( $i ); ?></span>
</label>
<?php
}
}
?>
</div>
<button class="btn-orcamento" type="submit">adicionar ao orçamento</button>
</form>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment