Updated use of labels for checkboxes

This commit is contained in:
Claudio Sanches 2016-11-09 22:41:14 -02:00
parent d66e8bd7c0
commit 1939abf059
5 changed files with 11 additions and 7 deletions

View File

@ -49,7 +49,9 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php if ( $checkout->enable_guest_checkout ) : ?> <?php if ( $checkout->enable_guest_checkout ) : ?>
<p class="form-row form-row-wide create-account"> <p class="form-row form-row-wide create-account">
<input class="input-checkbox" id="createaccount" <?php checked( ( true === $checkout->get_value( 'createaccount' ) || ( true === apply_filters( 'woocommerce_create_account_default_checked', false ) ) ), true ) ?> type="checkbox" name="createaccount" value="1" /> <label for="createaccount" class="checkbox"><?php _e( 'Create an account?', 'woocommerce' ); ?></label> <label class="checkbox">
<input class="input-checkbox" id="createaccount" <?php checked( ( true === $checkout->get_value( 'createaccount' ) || ( true === apply_filters( 'woocommerce_create_account_default_checked', false ) ) ), true ) ?> type="checkbox" name="createaccount" value="1" /> <?php _e( 'Create an account?', 'woocommerce' ); ?>
</label>
</p> </p>
<?php endif; ?> <?php endif; ?>

View File

@ -25,8 +25,9 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php if ( true === WC()->cart->needs_shipping_address() ) : ?> <?php if ( true === WC()->cart->needs_shipping_address() ) : ?>
<h3 id="ship-to-different-address"> <h3 id="ship-to-different-address">
<label for="ship-to-different-address-checkbox" class="checkbox"><?php _e( 'Ship to a different address?', 'woocommerce' ); ?></label> <label class="checkbox">
<input id="ship-to-different-address-checkbox" class="input-checkbox" <?php checked( apply_filters( 'woocommerce_ship_to_different_address_checked', 'shipping' === get_option( 'woocommerce_ship_to_destination' ) ? 1 : 0 ), 1 ); ?> type="checkbox" name="ship_to_different_address" value="1" /> <input id="ship-to-different-address-checkbox" class="input-checkbox" <?php checked( apply_filters( 'woocommerce_ship_to_different_address_checked', 'shipping' === get_option( 'woocommerce_ship_to_destination' ) ? 1 : 0 ), 1 ); ?> type="checkbox" name="ship_to_different_address" value="1" /> <?php _e( 'Ship to a different address?', 'woocommerce' ); ?>
</label>
</h3> </h3>
<div class="shipping_address"> <div class="shipping_address">

View File

@ -13,8 +13,9 @@ if ( ! defined( 'ABSPATH' ) ) {
if ( wc_get_page_id( 'terms' ) > 0 && apply_filters( 'woocommerce_checkout_show_terms', true ) ) : ?> if ( wc_get_page_id( 'terms' ) > 0 && apply_filters( 'woocommerce_checkout_show_terms', true ) ) : ?>
<?php do_action( 'woocommerce_checkout_before_terms_and_conditions' ); ?> <?php do_action( 'woocommerce_checkout_before_terms_and_conditions' ); ?>
<p class="form-row terms wc-terms-and-conditions"> <p class="form-row terms wc-terms-and-conditions">
<input type="checkbox" class="input-checkbox" name="terms" <?php checked( apply_filters( 'woocommerce_terms_is_checked_default', isset( $_POST['terms'] ) ), true ); ?> id="terms" /> <label class="checkbox">
<label for="terms" class="checkbox"><?php printf( __( 'I&rsquo;ve read and accept the <a href="%s" target="_blank">terms &amp; conditions</a>', 'woocommerce' ), esc_url( wc_get_page_permalink( 'terms' ) ) ); ?> <span class="required">*</span></label> <input type="checkbox" class="input-checkbox" name="terms" <?php checked( apply_filters( 'woocommerce_terms_is_checked_default', isset( $_POST['terms'] ) ), true ); ?> id="terms" /> <?php printf( __( 'I&rsquo;ve read and accept the <a href="%s" target="_blank">terms &amp; conditions</a>', 'woocommerce' ), esc_url( wc_get_page_permalink( 'terms' ) ) ); ?> <span class="required">*</span>
</label>
<input type="hidden" name="terms-field" value="1" /> <input type="hidden" name="terms-field" value="1" />
</p> </p>
<?php do_action( 'woocommerce_checkout_after_terms_and_conditions' ); ?> <?php do_action( 'woocommerce_checkout_after_terms_and_conditions' ); ?>

View File

@ -47,7 +47,7 @@ if ( is_user_logged_in() ) {
<?php wp_nonce_field( 'woocommerce-login' ); ?> <?php wp_nonce_field( 'woocommerce-login' ); ?>
<input type="submit" class="button" name="login" value="<?php esc_attr_e( 'Login', 'woocommerce' ); ?>" /> <input type="submit" class="button" name="login" value="<?php esc_attr_e( 'Login', 'woocommerce' ); ?>" />
<input type="hidden" name="redirect" value="<?php echo esc_url( $redirect ) ?>" /> <input type="hidden" name="redirect" value="<?php echo esc_url( $redirect ) ?>" />
<label for="rememberme" class="inline"> <label class="inline">
<input name="rememberme" type="checkbox" id="rememberme" value="forever" /> <?php _e( 'Remember me', 'woocommerce' ); ?> <input name="rememberme" type="checkbox" id="rememberme" value="forever" /> <?php _e( 'Remember me', 'woocommerce' ); ?>
</label> </label>
</p> </p>

View File

@ -54,7 +54,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<p class="form-row"> <p class="form-row">
<?php wp_nonce_field( 'woocommerce-login', 'woocommerce-login-nonce' ); ?> <?php wp_nonce_field( 'woocommerce-login', 'woocommerce-login-nonce' ); ?>
<input type="submit" class="woocommerce-Button button" name="login" value="<?php esc_attr_e( 'Login', 'woocommerce' ); ?>" /> <input type="submit" class="woocommerce-Button button" name="login" value="<?php esc_attr_e( 'Login', 'woocommerce' ); ?>" />
<label for="rememberme" class="inline"> <label class="inline">
<input class="woocommerce-Input woocommerce-Input--checkbox" name="rememberme" type="checkbox" id="rememberme" value="forever" /> <?php _e( 'Remember me', 'woocommerce' ); ?> <input class="woocommerce-Input woocommerce-Input--checkbox" name="rememberme" type="checkbox" id="rememberme" value="forever" /> <?php _e( 'Remember me', 'woocommerce' ); ?>
</label> </label>
</p> </p>