| @@ -1,70 +1,64 @@ | ||
| 1 | -<?php | |
| 2 | -/** | |
| 3 | - * Template for displaying log in form. | |
| 4 | - * | |
| 5 | - * This template can be overridden by copying it to yourtheme/learnpress/checkout/form-login.php. | |
| 6 | - * | |
| 7 | - * @author ThimPress | |
| 8 | - * @package Learnpress/Templates | |
| 9 | - * @version 4.0.0 | |
| 10 | - */ | |
| 11 | - | |
| 12 | -defined( 'ABSPATH' ) || exit(); | |
| 13 | - | |
| 14 | -if ( is_user_logged_in() ) { | |
| 15 | - return; | |
| 16 | -} | |
| 17 | - | |
| 18 | -$checked = 'checked="checked"'; | |
| 19 | -if ( ! is_user_logged_in() && LearnPress::instance()->checkout()->is_enable_guest_checkout() ) { | |
| 20 | - $checked = ''; | |
| 21 | -} | |
| 22 | -?> | |
| 23 | - | |
| 24 | -<input type="radio" id="checkout-account-switch-to-login" <?php echo $checked ?> name="checkout-account-switch-form" value="login"/> | |
| 25 | -<div id="checkout-account-login" class="lp-checkout-block left"> | |
| 26 | - | |
| 27 | - <h4><?php esc_html_e( 'Sign in', 'learnpress' ); ?></h4> | |
| 28 | - | |
| 29 | - <ul class="lp-form-fields"> | |
| 30 | - <li class="form-field"> | |
| 31 | - <label for="username"><?php esc_html_e( 'Username or email', 'learnpress' ); ?> <span class="required">*</span></label> | |
| 32 | - <input type="text" name="username" id="username" placeholder="<?php esc_attr_e( 'Email or username', 'learnpress' ); ?>" autocomplete="username" /> | |
| 33 | - </li> | |
| 34 | - <li class="form-field"> | |
| 35 | - <label for="password"><?php esc_html_e( 'Password', 'learnpress' ); ?> <span class="required">*</span></label> | |
| 36 | - <input type="password" name="password" id="password" placeholder="<?php esc_attr_e( 'Password', 'learnpress' ); ?>" autocomplete="current-password" /> | |
| 37 | - </li> | |
| 38 | - </ul> | |
| 39 | - | |
| 40 | - <?php do_action( 'learn-press/after-checkout-account-login-fields' ); ?> | |
| 41 | - | |
| 42 | -<!-- <input type="hidden" name="learn-press-checkout-nonce" value="--><?php //echo wp_create_nonce( 'learn-press-checkout-login' ); ?><!--">--> | |
| 43 | - <p class="lp-checkout-remember"> | |
| 44 | - <label> | |
| 45 | - <input type="checkbox" name="rememberme"/> | |
| 46 | - <?php esc_html_e( 'Remember me', 'learnpress' ); ?> | |
| 47 | - </label> | |
| 48 | - | |
| 49 | - <a class="lp-lost-password-link" href="<?php echo esc_url_raw( wp_lostpassword_url() ); ?>"> | |
| 50 | - <?php esc_html_e( 'Lost password?', 'learnpress' ); ?> | |
| 51 | - </a> | |
| 52 | - </p> | |
| 53 | - | |
| 54 | - <?php | |
| 55 | - // Add hook of WordPress | |
| 56 | - do_action( 'login_form' ); | |
| 57 | - do_action( 'login_enqueue_scripts' ); | |
| 58 | - ?> | |
| 59 | - | |
| 60 | - <p class="lp-checkout-sign-up-link"> | |
| 61 | - <?php if ( LearnPress::instance()->checkout()->is_enable_register() ) : ?> | |
| 62 | - <?php esc_html_e( 'Don\'t have an account?', 'learnpress' ); ?> | |
| 63 | - <a href="javascript: void(0);"> | |
| 64 | - <label for="checkout-account-switch-to-register"><?php echo esc_html_x( 'Sign up', 'checkout sign up link', 'learnpress' ); ?></label> | |
| 65 | - </a>. | |
| 66 | - <?php endif; ?> | |
| 67 | - | |
| 68 | - <?php learn_press_get_template( 'checkout/guest-checkout-link' ); ?> | |
| 69 | - </p> | |
| 70 | -</div> | |
| 1 | +<?php | |
| 2 | +/** | |
| 3 | + * Template for displaying log in form. | |
| 4 | + * | |
| 5 | + * This template can be overridden by copying it to yourtheme/learnpress/checkout/form-login.php. | |
| 6 | + * | |
| 7 | + * @author ThimPress | |
| 8 | + * @package Learnpress/Templates | |
| 9 | + * @version 4.0.0 | |
| 10 | + */ | |
| 11 | + | |
| 12 | +defined( 'ABSPATH' ) || exit(); | |
| 13 | + | |
| 14 | +if ( is_user_logged_in() ) { | |
| 15 | + return; | |
| 16 | +} | |
| 17 | +?> | |
| 18 | + | |
| 19 | +<div id="checkout-account-login" class="lp-checkout-block left"> | |
| 20 | + | |
| 21 | + <h4><?php esc_html_e( 'Sign in', 'learnpress' ); ?></h4> | |
| 22 | + | |
| 23 | + <ul class="lp-form-fields"> | |
| 24 | + <li class="form-field"> | |
| 25 | + <label for="username"><?php esc_html_e( 'Username or email', 'learnpress' ); ?> <span class="required">*</span></label> | |
| 26 | + <input type="text" name="username" id="username" placeholder="<?php esc_attr_e( 'Email or username', 'learnpress' ); ?>" autocomplete="username" /> | |
| 27 | + </li> | |
| 28 | + <li class="form-field"> | |
| 29 | + <label for="password"><?php esc_html_e( 'Password', 'learnpress' ); ?> <span class="required">*</span></label> | |
| 30 | + <input type="password" name="password" id="password" placeholder="<?php esc_attr_e( 'Password', 'learnpress' ); ?>" autocomplete="current-password" /> | |
| 31 | + </li> | |
| 32 | + </ul> | |
| 33 | + | |
| 34 | + <?php do_action( 'learn-press/after-checkout-account-login-fields' ); ?> | |
| 35 | + | |
| 36 | +<!-- <input type="hidden" name="learn-press-checkout-nonce" value="--><?php //echo wp_create_nonce( 'learn-press-checkout-login' ); ?><!--">--> | |
| 37 | + <p class="lp-checkout-remember"> | |
| 38 | + <label> | |
| 39 | + <input type="checkbox" name="rememberme"/> | |
| 40 | + <?php esc_html_e( 'Remember me', 'learnpress' ); ?> | |
| 41 | + </label> | |
| 42 | + | |
| 43 | + <a class="lp-lost-password-link" href="<?php echo esc_url_raw( wp_lostpassword_url() ); ?>"> | |
| 44 | + <?php esc_html_e( 'Lost password?', 'learnpress' ); ?> | |
| 45 | + </a> | |
| 46 | + </p> | |
| 47 | + | |
| 48 | + <?php | |
| 49 | + // Add hook of WordPress | |
| 50 | + do_action( 'login_form' ); | |
| 51 | + do_action( 'login_enqueue_scripts' ); | |
| 52 | + ?> | |
| 53 | + | |
| 54 | + <p class="lp-checkout-sign-up-link"> | |
| 55 | + <?php if ( LearnPress::instance()->checkout()->is_enable_register() ) : ?> | |
| 56 | + <?php esc_html_e( 'Don\'t have an account?', 'learnpress' ); ?> | |
| 57 | + <a href="<?php echo esc_url( add_query_arg( 'is_form_register', '1', LP_Helper::get_link_no_cache( learn_press_get_page_link( 'checkout' ) ) ) ); ?>"> | |
| 58 | + <?php echo esc_html_x( 'Sign up', 'checkout sign up link', 'learnpress' ); ?> | |
| 59 | + </a>. | |
| 60 | + <?php endif; ?> | |
| 61 | + | |
| 62 | + <?php learn_press_get_template( 'checkout/guest-checkout-link' ); ?> | |
| 63 | + </p> | |
| 64 | +</div> | |