WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#31959 closed defect (bug) (invalid)

New user is created even when errors in custom registration fields are returned.

Reported by: michalrusina 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)

#1 @boonebgorges
6 years ago

  • Keywords reporter-feedback added

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' )

#2 @michalrusina
6 years ago

  • Resolution set to invalid
  • Status changed from new to closed

#3 @SergeyBiryukov
6 years ago

  • Milestone Awaiting Review deleted

This ticket was mentioned in Slack in #core by mikelopez. View the logs.


6 years ago

Note: See TracTickets for help on using tickets.