Skip to content

Instantly share code, notes, and snippets.

@fjarrett
Created December 18, 2014 02:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fjarrett/4887016fd3f69463ccb5 to your computer and use it in GitHub Desktop.
Save fjarrett/4887016fd3f69463ccb5 to your computer and use it in GitHub Desktop.
Custom user registration jQuery
/* globals fjarrett */
jQuery( function( $ ) {
$( document ).on( 'click', 'form #submit-registration', function (e) {
$.ajax({
type: 'POST',
url: fjarrett.ajaxurl,
data: {
action: 'fjarrett_user_registration',
registration_token: $( '#registration_token' ).val(),
registration_nonce: $( 'input[name="registration_nonce"]' ).val(),
user_login: $( '#user_login' ).val(),
user_pass: $( '#user_pass' ).val(),
first_name: $( '#first_name' ).val(),
last_name: $( '#last_name' ).val(),
user_email: $( '#last_name' ).val()
},
dataType: 'json',
success: function (response) {
if ( true === response.success ) {
window.location.replace( response.data );
} else if ( false === response.success && response.data ) {
window.alert( response.data );
}
}
});
});
});
@fjarrett
Copy link
Author

See AJAX registration process 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