form-login.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /**
  3. * Auth form login
  4. *
  5. * This template can be overridden by copying it to yourtheme/woocommerce/auth/form-login.php.
  6. *
  7. * HOWEVER, on occasion WooCommerce will need to update template files and you
  8. * (the theme developer) will need to copy the new files to your theme to
  9. * maintain compatibility. We try to do this as little as possible, but it does
  10. * happen. When this occurs the version of the template file will be bumped and
  11. * the readme will list any important changes.
  12. *
  13. * @see https://docs.woocommerce.com/document/template-structure/
  14. * @package WooCommerce/Templates/Auth
  15. * @version 3.4.0
  16. */
  17. defined( 'ABSPATH' ) || exit;
  18. do_action( 'woocommerce_auth_page_header' ); ?>
  19. <h1>
  20. <?php
  21. /* translators: %s: app name */
  22. printf( esc_html__( '%s would like to connect to your store', 'woocommerce' ), esc_html( $app_name ) );
  23. ?>
  24. </h1>
  25. <?php wc_print_notices(); ?>
  26. <p>
  27. <?php
  28. /* translators: %1$s: app name, %2$s: URL */
  29. echo wp_kses_post( sprintf( __( 'To connect to %1$s you need to be logged in. Log in to your store below, or <a href="%2$s">cancel and return to %1$s</a>', 'woocommerce' ), esc_html( wc_clean( $app_name ) ), esc_url( $return_url ) ) );
  30. ?>
  31. </p>
  32. <form method="post" class="wc-auth-login">
  33. <p class="form-row form-row-wide">
  34. <label for="username"><?php esc_html_e( 'Username or email address', 'woocommerce' ); ?>&nbsp;<span class="required">*</span></label>
  35. <input type="text" class="input-text" name="username" id="username" value="<?php echo ( ! empty( $_POST['username'] ) ) ? esc_attr( $_POST['username'] ) : ''; ?>" /><?php //@codingStandardsIgnoreLine ?>
  36. </p>
  37. <p class="form-row form-row-wide">
  38. <label for="password"><?php esc_html_e( 'Password', 'woocommerce' ); ?>&nbsp;<span class="required">*</span></label>
  39. <input class="input-text" type="password" name="password" id="password" />
  40. </p>
  41. <p class="wc-auth-actions">
  42. <?php wp_nonce_field( 'woocommerce-login', 'woocommerce-login-nonce' ); ?>
  43. <button type="submit" class="button button-large button-primary wc-auth-login-button" name="login" value="<?php esc_attr_e( 'Login', 'woocommerce' ); ?>"><?php esc_html_e( 'Login', 'woocommerce' ); ?></button>
  44. <input type="hidden" name="redirect" value="<?php echo esc_url( $redirect_url ); ?>" />
  45. </p>
  46. </form>
  47. <?php do_action( 'woocommerce_auth_page_footer' ); ?>