Because there is context lacking I’m not able to fix all your problems. One of the mistakes I see is that in your code this line:
if (email_exists($email) === false) {
$errors[] = 'E-mail address is already in use.';
}
Must be:
if(email_exists($email)){ etc.
Because you check whether the email_exists function returns an ID when it exists (translates in true) or does not exist, which will give false. Could you give more context (e.g. the form in HTML) for the rest of your question?
EDIT: you make the same mistake with username_exists($username) === false
which should just be if(username_exists($username))
instead. Same logic applies.
EDIT EDIT: oh, actually you do that mistake more. Also with in_array( $username, $invalid_usernames ) === false
must be: in_array( $username, $invalid_usernames )
Now you are checking the exact opposite of what you want to check I suppose.
Related Posts:
- How can I be certain that a user has verified their email after registration?
- Email confirmation in user registration form without a plugin
- not sending correct link to set the password in registration email [closed]
- Not receiving any sign up mail, when user registers… Both admin & user
- Placeholder text for registration form
- Use the user_activation_key for other purposes
- How to check if the user registration is allowed/active?
- how to disable user confirmation from administration?
- Custom registration form page/template
- Insert “New User” and update/set meta data at once
- Send automatic email to user after wp_create_user
- How to disable or protect against disposable email accounts?
- Registration key
- User defined password at registration – registration email sends auto generated pass
- Advice on setting up a site with front end registration
- How to add a description to the user name input field in the registration form?
- How to add a checkbox to registration and user profile?
- Payment on Registration?
- WordPress members-only page with link visible only to members
- How do I show errors after validation with a custom form frontend?
- How can I find users that didn’t set a password?
- Send custom signup approval email to different Administrators selectively
- Registering without e-mail adress!
- Batch users creation
- After e-junkie payment, send a http post to register user automatically?
- How to add additional information to a user on user creation?
- How to bypass the username as a required field in registration and just use email address instead?
- Does the user_register change in multisite?
- Invalid key on activation and password reset
- What’s wrong with Customizing new user notification email by add_filter?
- Where are people registering on my website?
- How to disallow user to register with a specific word in the username?
- How to stop WordPress emailing a password
- Change User Registration
- user_register not triggering with email verification
- Creating custom registration and login link in wordpress
- Adding register & login at top right corner
- Backend user creation form with additional language field
- Restrict certain character combinations in username during registration
- Register users without confirmation
- Override default new user registration email with custom message (non sub-domain multi-site installation)
- Include “registration.php” for custom registration form?
- Regsitration form on External page
- can registration be enabled programatically?
- allow only lowercase user registrations
- my custom css file downloads then it STOPS!
- Filter for users on custom post type
- Registration area + reserved area
- I want to add a tax-ID field in registration form and upon submission, perform a lookup by tax-ID
- Please suggest me some plugins in WordPress networking
- Cannot login due to incorrect password right after registration?
- wordpress – user registration ( signup registration )
- Disable password limitations
- How to integrate CAPTCHA on register page? [closed]
- Profile picture in registration form WordPress [closed]
- Register multiple users in one form
- Register through url
- loading custom registration template
- Add ‘first name’, ‘last name’, ‘date of birth’ and ‘terms and conditions’ to register fields?
- How to show password fields on registration form w/o plugins
- Is there any way to not require email address or disable notification upon setting up a member?
- I want to remove the http:// that is added automaticly on the user profile adress
- How to enable user registration for specific country and disable registration from all other countries?
- How to add user registration and signup in WordPress and create members only page?
- Wikipedia – CMS
- remove (error:) from registration errors woocommerce
- Action Hook that fires function upon registration at Woocommerce checkout
- Send user auto generated password on different email
- Redirection after registration
- My new website registration error
- Updated : how to make email optional while user registration using default wordpress form
- Adding email list as registered users
- Registration – website crashes, error 403
- Link with password is not sent to the new user
- How can I fetch user registration age
- I want to give every new registering user a unique key apart from password field for external use
- Is it possible to remove the password field in the registration page in woocommerce?
- Send a password to a user who has just registered for a member area
- The requested URL /wordpress/register/ was not found on this server
- I have restricted the username to numerical format but not able to integrate the same with PeepSo plugin
- What’s the Point of Spam Registrations?
- Update a user field with a generated text
- Custom Registration with Select and Upload function
- Macros for WordPress, creating subdomains out of registrations for current domain
- How to make user to logged into website & redirect to homepage after successful registration?
- generate an auto incremented id number when a new user is registered
- Remove wp-login link from auto generated wordpress’s email
- Multisite/Network What file to edit to change the “new blog” registration text
- How do spam users register while I’ve only enabled registration by Gmail via Janrain?
- Wrong user registration date in wordpress
- What hooks, actions or filters i can use to customize wordpress registration page and form?
- Can email address be used as user name?
- Website visible only to Registered users (non wp-admin)
- Plugin recommendation for directory site [closed]
- Fields in register page is pre-filled out with name and email
- Login to comment: not just user and email
- Limit username to specific characters (A-Z and 0-9)
- Group users by meta_value
- Change default error message “This email address is already in use” when registering a new user in WordPress using Caldera Forms
- Run custom validation only if all other wordpress registration form validation was successful