Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dhargitai/f1652706a43f75cb585801254abc6e5d to your computer and use it in GitHub Desktop.
Save dhargitai/f1652706a43f75cb585801254abc6e5d to your computer and use it in GitHub Desktop.
<tbody>
<tr>
<?php foreach ( $attributes as $attribute_name => $options ) : ?>
<td class="label" style="width: 50%;"><label for="<?php echo esc_attr( sanitize_title( $attribute_name ) ); ?>"><?php echo wc_attribute_label( $attribute_name ); // WPCS: XSS ok. ?></label></td>
<?php endforeach; ?>
</tr>
<tr>
<?php foreach ( $attributes as $attribute_name => $options ) : ?>
<td class="value">
<?php
wc_dropdown_variation_attribute_options( array(
'options' => $options,
'attribute' => $attribute_name,
'product' => $product,
) );
echo end( $attribute_keys ) === $attribute_name ? wp_kses_post( apply_filters( 'woocommerce_reset_variations_link', '<a class="reset_variations" href="#">' . esc_html__( 'Clear', 'woocommerce' ) . '</a>' ) ) : '';
?>
</td>
<?php endforeach; ?>
</tr>
</tbody>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment