1. Home
  2. Docs
  3. WooCommerce Ajax Login/Register
  4. Code Snippets

Code Snippets

Redirect customer to any custom page after login/register. Just use below snippet by using this snippet you can redirect to customer homepage. You just need to modify this snippet if you want to redirect to any other page.

Snippet for login redirect

Snippet for registration redirect

Just use below snippet by using this snippet you can maintaining login status after successful login. You just need to add this snippet code in a function.php file if you want to maintain login status.

Snippet for After login registration

Snippet for Change Password Strength message for Registration form

Just use below snippet by using this snippet you can Change Password Strength message for Registration form. You just need to add this snippet code in a function.php file if you want to change password strength message.

/*
* Change the message of the password strength in registration form.
*/
add_filter( 'ajaxlogin_register_password_message', 'add_custom_message_func', 30, 1 );
function add_custom_message_func( $message ){
$message = sprintf( __( 'Write your custom message here' ) );
return $message;
}

Snippet for Change Reset Password message

Just use below snippet by using this snippet you can Change Reset Password message for forgot form. You just need to add this snippet code in a function.php file if you want to reset password message.

/*
* Change the message of the reset password message.
*/
add_filter( 'ajaxlogin_lost_password_message', 'cbr_add_custom_message_func', 10, 1 );
function cbr_add_custom_message_func( $message ){
	return "Write your custom meessage here";
}
Was this article helpful to you? Yes No

How can we help?