Skip to content

Instantly share code, notes, and snippets.

@fjarrett
Last active August 29, 2015 14:11
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fjarrett/1c122226e56e6f352b4e to your computer and use it in GitHub Desktop.
Save fjarrett/1c122226e56e6f352b4e to your computer and use it in GitHub Desktop.
Custom user registration form
<form method="post">
<p>
<label for="user_login">Username</label>
<input type="text" name="user_login" id="user_login" placeholder="Username" required>
</p>
<p>
<label for="user_pass">Password</label>
<input type="password" name="user_pass" id="user_pass" minlength="12" placeholder="Password" autocomplete="off" required>
</p>
<p>
<label for="user_pass_confirm">Confirm Password</label>
<input type="password" name="user_pass_confirm" id="user_pass_confirm" minlength="12" placeholder="Confirm Password" autocomplete="off" required>
</p>
<p>
<label for="first_name">Name</label>
<input type="text" name="first_name" id="first_name" placeholder="First" required>
<input type="text" name="last_name" id="last_name" placeholder="Last" required>
</p>
<p>
<label for="user_email">E-mail Address</label>
<input type="email" name="user_email" id="user_email" placeholder="E-mail Address" required>
</p>
<?php $registration_token = strtolower( wp_generate_password( 10, false, false ) ) ?>
<input type="hidden" name="registration_token" value="<?php echo esc_attr( $registration_token ) ?>">
<?php wp_nonce_field( 'user_registration-' . $registration_token, 'registration_nonce' ) ?>
<p>
<button type="submit" id="submit-registration">Register</button>
</p>
</form>
@fjarrett
Copy link
Author

@fjarrett
Copy link
Author

See registration process via AJAX here https://gist.github.com/fjarrett/1c4a5917fb180028d710

@fjarrett
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment