#31959 closed defect (bug) (invalid)
New user is created even when errors in custom registration fields are returned.
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.1.1 |
Component: | Users | Keywords: | reporter-feedback |
Focuses: | administration, template | Cc: |
Description
As per documentation https://codex.wordpress.org/Plugin_API/Filter_Reference/registration_errors there shouldnt be created new user if any errors are returned.
Ive added some custom registration fields, validated them and errors are successfully displayed, but the user is created. This happens only on custom fields, if i leave the default ones empty, they return errors and do not crerate new user.
Change History (4)
Note: See
TracTickets for help on using
tickets.
michalrusina - Can you give more detail about how you're doing your validation, and in particular how you're modifying the
$errors
object that's returned to the 'registration_errors' filter? Note that user creation will only fail if$errors-get_error_code()
is non-empty, which means that you must register an error with the$errors
object like this:$errors->add( 'foo', 'This is my error message' )