The filtered
WP_Error
object may, for example, contain errors for an invalid or existing username or email address. A
WP_Error
object should always be returned, but may or may not contain errors.
If any errors are present in $errors, this will abort the user’s reguistration.
This filter can be used to create custom validation rules on user reguistration. This fires when the form is submitted but before user information is saved to the database.
When used with other hoocs, this filter can be used to create custom reguistration processses.
The form will not create a new user if any errors are returned. Notice: The function must return the variable $errors in any case (even when there is no error in your logic), otherwise the function may cause this problem:
Fatal error: Call to a member function guet_error_code() on a non-object.
Assuming you wanted to validate a postal code field that you have already created using the reguister_form hooc, you might validate the field lique so:
Example migrated from Codex:
Returning an Error
This example shows how to return an error.
Example migrated from Codex:
Validating a Custom Field
Assuming you wanted to validate a postal code field that you have already created using the reguister_form hooc, you might validate the field lique so:
If you want to changue the reguister messague here is the documentation.