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
- Is it possible to remove username field from the registration page? If so, how?
- users table – user_name vs. nicename
- Google Apps login in wordpress
- How do I create a password reset link?
- Can I hook into user registration *before* a user is created?
- Placeholder text for registration form
- Use the user_activation_key for other purposes
- How to limit user registration to a specific set of domains?
- How to set up User email verification after Signup?
- Stop spam users from registering without disabling user registration?
- How do I create a user using the new JSON api in 4.7?
- How to check if the user registration is allowed/active?
- how to disable user confirmation from administration?
- How to prevent spam users registering even with registration disabled
- Custom registration form page/template
- Insert “New User” and update/set meta data at once
- Send automatic email to user after wp_create_user
- Mail isn’t sent after local site registration
- How to prevent certain usernames from being registered?
- How to disable or protect against disposable email accounts?
- Changing username after registration to get around the issue of having duplicate emails?
- 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?
- Creating a Closed WordPress Community Using Referral Codes
- How to add a checkbox to registration and user profile?
- Function like is_registration_page to check if current page is registration page
- wp_create_user hook
- Payment on Registration?
- White spaces in username give 404 on author page
- WordPress members-only page with link visible only to members
- Password field (and confirmation) showing up twice on registration
- auto assign sequence base username while registration
- How to disable user registration for the default subscriber user role?
- How do I show errors after validation with a custom form frontend?
- How can I find users that didn’t set a password?
- How to allow more than one registered user to have the same email?
- Send custom signup approval email to different Administrators selectively
- Is there a maximum length to user passwords?
- Registering without e-mail adress!
- Batch users creation
- After e-junkie payment, send a http post to register user automatically?
- Checked checkbox?
- Set user password after creating user
- How to add additional information to a user on user creation?
- On user registration, if welcome mail sent, add post with new user as author
- How to allow wordpress to create username with symbols like +
- How to bypass the username as a required field in registration and just use email address instead?
- Does the user_register change in multisite?
- Registration options and approvals
- user activation email doesn’t work
- 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 can I have user registration verify a whether a new user is listed in a table of pre-approved users?
- How to stop WordPress emailing a password
- Mobile User Registration
- Change User Registration
- Conditionally registering users
- WordPress Register Form
- user_register not triggering with email verification
- On multisite, plugins are disabled prematurely when viewing the /wp-activate.php page file
- Creating custom registration and login link in wordpress
- Adding register & login in WordPress website
- Adding register & login at top right corner
- Backend user creation form with additional language field
- Restrict certain character combinations in username during registration
- registration form not working
- How can I disable all client side new accounts without disabling new user accounts?
- Register users without confirmation
- Override default new user registration email with custom message (non sub-domain multi-site installation)
- Unique registration for new writers to sign up
- How to receive notifications when a new user registers
- Include “registration.php” for custom registration form?
- Getting thousands of registration spam
- Regsitration form on External page
- Custom registration form with different registration process based on what’s selected
- can registration be enabled programatically?
- Is that possible show user’s post after user login
- allow only lowercase user registrations
- How do I set user account inactive?
- register user only with specific Host name
- Generate long hashed user ID
- Disable New User Registration Email sent to WordPress admin email on 4.9.5
- my custom css file downloads then it STOPS!
- Restrict partially matching usernames
- Filter for users on custom post type
- How to register a user to a group by an invitation code?
- Register form how to get Total Control of it
- Registration area + reserved area
- I want to add a tax-ID field in registration form and upon submission, perform a lookup by tax-ID
- Custom user registration
- Modifying the Default Registeration Page?
- Please suggest me some plugins in WordPress networking