/templates/registration-form.php

  1. <?php 
  2. /** 
  3. * Registration form. 
  4. * 
  5. * @author Jeroen Sormani 
  6. * @package WooCommerce-Simple-Registration 
  7. * @version 1.0.0 
  8. */ 
  9.  
  10. if ( ! defined( 'ABSPATH' ) ) exit; 
  11. wp_enqueue_script( 'wc-password-strength-meter' ); 
  12.  
  13. ?><div class="registration-form woocommerce"> 
  14.  
  15. <?php wc_print_notices(); ?> 
  16.  
  17. <h2><?php _e( 'Register', 'woocommerce' ); ?></h2> 
  18.  
  19. <form method="post" class="register"> 
  20.  
  21. <?php do_action( 'woocommerce_register_form_start' ); ?> 
  22.  
  23. <?php if ( 'no' === get_option( 'woocommerce_registration_generate_username' ) ) : ?> 
  24.  
  25. <p class="woocommerce-FormRow woocommerce-FormRow--wide form-row form-row-wide"> 
  26. <label for="reg_username"><?php _e( 'Username', 'woocommerce' ); ?> <span class="required">*</span></label> 
  27. <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'] ); ?>" /> 
  28. </p> 
  29.  
  30. <?php endif; ?> 
  31.  
  32. <p class="woocommerce-FormRow woocommerce-FormRow--wide form-row form-row-wide"> 
  33. <label for="reg_email"><?php _e( 'Email address', 'woocommerce' ); ?> <span class="required">*</span></label> 
  34. <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'] ); ?>" /> 
  35. </p> 
  36.  
  37. <?php if ( 'no' === get_option( 'woocommerce_registration_generate_password' ) ) : ?> 
  38.  
  39. <p class="woocommerce-FormRow woocommerce-FormRow--wide form-row form-row-wide"> 
  40. <label for="reg_password"><?php _e( 'Password', 'woocommerce' ); ?> <span class="required">*</span></label> 
  41. <input type="password" class="woocommerce-Input woocommerce-Input--text input-text" name="password" id="reg_password" /> 
  42. </p> 
  43.  
  44. <?php endif; ?> 
  45.  
  46. <!-- Spam Trap --> 
  47. <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" /></div> 
  48.  
  49. <?php do_action( 'woocommerce_register_form' ); ?> 
  50. <?php do_action( 'register_form' ); ?> 
  51.  
  52. <p class="woocomerce-FormRow form-row"> 
  53. <?php wp_nonce_field( 'woocommerce-register', 'woocommerce-register-nonce' ); ?> 
  54. <input type="submit" class="woocommerce-Button button" name="register" value="<?php esc_attr_e( 'Register', 'woocommerce' ); ?>" /> 
  55. </p> 
  56.  
  57. <?php do_action( 'woocommerce_register_form_end' ); ?> 
  58.  
  59. </form> 
  60.  
  61. </div> 
.