Woocommerce Register Error

First you need to add a hidden field to registration form which can hold the URL where you want to redirect the user post registration. Below code will help you for that: <?php add_action( ‘register_form’, ‘hiddern_redirect_url’ ); function hiddern_redirect_url() { ?> <input type=”hidden” name=”redir_post_register” value=”<?php echo get_site_url(); ?>” /> <?php } ?> Then, using woocommerce_registration_redirect … Read more

How can I modify labels in default wordpress registration form? [duplicate]

If you are using default WordPress registration form. But there are no “Email” field. OK but you can try below code. if ($pagenow==’wp-login.php’) { add_filter( ‘gettext’, ‘user_email_login_text’, 20, 3 ); function user_email_login_text( $translated_text, $text, $domain ){ if ($translated_text == ‘Email’) { $translated_text=”Email required field”; } return $translated_text; } }

Custom registration fields not validating

the value of the checkbox wouldn’t be “checked” – it should equal whatever you put in the “value” attribute .. and i think you need an extra set of parentheses in the if statement for first_name to make sure your filter is firing you could try explicitly adding an error (with no validation checks) to … Read more

register_settings callback function erases data

in case of wrong value, the function has to return the original value then try this : function email_validation($data, $option, $original_value) { if (null == $data) { add_settings_error( ‘requiredTextFieldEmpty’, ’empty’, ‘Notification Email cannot be empty’, ‘error’ ); return $original_value; } else { if (!is_email($data)){ add_settings_error( ‘requiredTextFieldEmpty’, ’empty’, ‘Notification Email is not valid email address’, ‘error’ … Read more

wp_insert_user not returning anything

I found out what it was. I had an action hook for user_register on my functions.php. This action hook would automatically login the user after registration. After removing it, it worked. As requested, the hook was interfearing because I was already logged in. The hook would use wp_set_current_user($user_id); wp_set_auth_cookie($user_id); to log in after registration.