Update for Woocommerce 3.2.1 Compatibility

This commit is contained in:
Jason King 2017-10-19 23:05:43 +10:30 committed by GitHub
parent 64a81a46fb
commit 3479a9a8c6
1 changed files with 14 additions and 18 deletions

View File

@ -13,7 +13,7 @@
* @see https://docs.woocommerce.com/document/template-structure/ * @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes * @author WooThemes
* @package WooCommerce/Templates * @package WooCommerce/Templates
* @version 3.1.0 * @version 3.2.0
*/ */
if ( ! defined( 'ABSPATH' ) ) { if ( ! defined( 'ABSPATH' ) ) {
@ -36,17 +36,17 @@ if ( ! defined( 'ABSPATH' ) ) {
<h2><?php _e( 'Login', 'woocommerce' ); ?></h2> <h2><?php _e( 'Login', 'woocommerce' ); ?></h2>
<form method="post" class="login"> <form class="woocommerce-form woocommerce-form-login login" method="post">
<?php do_action( 'woocommerce_login_form_start' ); ?> <?php do_action( 'woocommerce_login_form_start' ); ?>
<p class="woocommerce-FormRow woocommerce-FormRow--wide form-row form-row-wide"> <p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide">
<label for="username"><?php _e( 'Username or email address', 'woocommerce' ); ?> <span class="required">*</span></label> <label for="username"><?php _e( 'Username or email address', 'woocommerce' ); ?> <span class="required">*</span></label>
<input type="text" class="woocommerce-Input woocommerce-Input--text input-text form-control" name="username" id="username" value="<?php if ( ! empty( $_POST['username'] ) ) echo esc_attr( $_POST['username'] ); ?>" /> <input type="text" class="woocommerce-Input woocommerce-Input--text input-text" name="username" id="username" value="<?php echo ( ! empty( $_POST['username'] ) ) ? esc_attr( $_POST['username'] ) : ''; ?>" />
</p> </p>
<p class="woocommerce-FormRow woocommerce-FormRow--wide form-row form-row-wide"> <p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide">
<label for="password"><?php _e( 'Password', 'woocommerce' ); ?> <span class="required">*</span></label> <label for="password"><?php _e( 'Password', 'woocommerce' ); ?> <span class="required">*</span></label>
<input class="woocommerce-Input woocommerce-Input--text input-text form-control" type="password" name="password" id="password" /> <input class="woocommerce-Input woocommerce-Input--text input-text" type="password" name="password" id="password" />
</p> </p>
<?php do_action( 'woocommerce_login_form' ); ?> <?php do_action( 'woocommerce_login_form' ); ?>
@ -54,8 +54,8 @@ 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="btn btn-outline-primary" name="login" value="<?php esc_attr_e( 'Login', 'woocommerce' ); ?>" /> <input type="submit" class="btn btn-outline-primary" name="login" value="<?php esc_attr_e( 'Login', 'woocommerce' ); ?>" />
<label for="rememberme" class="inline"> <label class="woocommerce-form__label woocommerce-form__label-for-checkbox inline">
<input class="woocommerce-Input woocommerce-Input--checkbox" name="rememberme" type="checkbox" id="rememberme" value="forever" /> <?php _e( 'Remember me', 'woocommerce' ); ?> <input class="woocommerce-form__input woocommerce-form__input-checkbox" name="rememberme" type="checkbox" id="rememberme" value="forever" /> <span><?php _e( 'Remember me', 'woocommerce' ); ?></span>
</label> </label>
</p> </p>
<p class="woocommerce-LostPassword lost_password"> <p class="woocommerce-LostPassword lost_password">
@ -80,34 +80,30 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php if ( 'no' === get_option( 'woocommerce_registration_generate_username' ) ) : ?> <?php if ( 'no' === get_option( 'woocommerce_registration_generate_username' ) ) : ?>
<p class="woocommerce-FormRow woocommerce-FormRow--wide form-row form-row-wide"> <p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide">
<label for="reg_username"><?php _e( 'Username', 'woocommerce' ); ?> <span class="required">*</span></label> <label for="reg_username"><?php _e( 'Username', 'woocommerce' ); ?> <span class="required">*</span></label>
<input type="text" class="woocommerce-Input woocommerce-Input--text input-text" name="username" id="reg_username" value="<?php if ( ! empty( $_POST['username'] ) ) echo esc_attr( $_POST['username'] ); ?>" /> <input type="text" class="woocommerce-Input woocommerce-Input--text input-text" name="username" id="reg_username" value="<?php echo ( ! empty( $_POST['username'] ) ) ? esc_attr( $_POST['username'] ) : ''; ?>" />
</p> </p>
<?php endif; ?> <?php endif; ?>
<p class="woocommerce-FormRow woocommerce-FormRow--wide form-row form-row-wide"> <p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide">
<label for="reg_email"><?php _e( 'Email address', 'woocommerce' ); ?> <span class="required">*</span></label> <label for="reg_email"><?php _e( 'Email address', 'woocommerce' ); ?> <span class="required">*</span></label>
<input type="email" class="woocommerce-Input woocommerce-Input--text input-text" name="email" id="reg_email" value="<?php if ( ! empty( $_POST['email'] ) ) echo esc_attr( $_POST['email'] ); ?>" /> <input type="email" class="woocommerce-Input woocommerce-Input--text input-text" name="email" id="reg_email" value="<?php echo ( ! empty( $_POST['email'] ) ) ? esc_attr( $_POST['email'] ) : ''; ?>" />
</p> </p>
<?php if ( 'no' === get_option( 'woocommerce_registration_generate_password' ) ) : ?> <?php if ( 'no' === get_option( 'woocommerce_registration_generate_password' ) ) : ?>
<p class="woocommerce-FormRow woocommerce-FormRow--wide form-row form-row-wide"> <p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide">
<label for="reg_password"><?php _e( 'Password', 'woocommerce' ); ?> <span class="required">*</span></label> <label for="reg_password"><?php _e( 'Password', 'woocommerce' ); ?> <span class="required">*</span></label>
<input type="password" class="woocommerce-Input woocommerce-Input--text input-text" name="password" id="reg_password" /> <input type="password" class="woocommerce-Input woocommerce-Input--text input-text" name="password" id="reg_password" />
</p> </p>
<?php endif; ?> <?php endif; ?>
<!-- Spam Trap -->
<div style="<?php echo ( ( is_rtl() ) ? 'right' : 'left' ); ?>: -999em; position: absolute;"><label for="trap"><?php _e( 'Anti-spam', 'woocommerce' ); ?></label><input type="text" name="email_2" id="trap" tabindex="-1" autocomplete="off" /></div>
<?php do_action( 'woocommerce_register_form' ); ?> <?php do_action( 'woocommerce_register_form' ); ?>
<?php do_action( 'register_form' ); ?>
<p class="woocomerce-FormRow form-row"> <p class="woocommerce-FormRow form-row">
<?php wp_nonce_field( 'woocommerce-register', 'woocommerce-register-nonce' ); ?> <?php wp_nonce_field( 'woocommerce-register', 'woocommerce-register-nonce' ); ?>
<input type="submit" class="woocommerce-Button button" name="register" value="<?php esc_attr_e( 'Register', 'woocommerce' ); ?>" /> <input type="submit" class="woocommerce-Button button" name="register" value="<?php esc_attr_e( 'Register', 'woocommerce' ); ?>" />
</p> </p>