Login form initial state. Closes #2505.

This commit is contained in:
Mike Jolley 2013-02-25 10:17:16 +00:00
parent 48a4ce1384
commit 69db6a4262
3 changed files with 7 additions and 5 deletions

View File

@ -20,7 +20,8 @@ $info_message = apply_filters( 'woocommerce_checkout_login_message', __( 'Return
woocommerce_login_form(
array(
'message' => __( 'If you have shopped with us before, please enter your details in the boxes below. If you are a new customer please proceed to the Billing & Shipping section.', 'woocommerce' ),
'redirect' => get_permalink( woocommerce_get_page_id( 'checkout') )
'redirect' => get_permalink( woocommerce_get_page_id( 'checkout') ),
'hidden' => true
)
);
?>

View File

@ -13,8 +13,8 @@ global $woocommerce;
if (is_user_logged_in()) return;
?>
<form method="post" class="login">
<?php if ($message) echo wpautop(wptexturize($message)); ?>
<form method="post" class="login" <?php if ( $hidden ) echo 'style="display:none;"'; ?>>
<?php if ( $message ) echo wpautop( wptexturize( $message ) ); ?>
<p class="form-row form-row-first">
<label for="username"><?php _e( 'Username or email', 'woocommerce' ); ?> <span class="required">*</span></label>

View File

@ -944,8 +944,9 @@ if ( ! function_exists( 'woocommerce_login_form' ) ) {
function woocommerce_login_form( $args = array() ) {
$defaults = array(
'message' => '',
'redirect' => ''
'message' => '',
'redirect' => '',
'hidden' => false
);
$args = wp_parse_args( $args, $defaults );