Title: Validating Custom Profile Fields During Registration
Last modified: August 20, 2016

---

# Validating Custom Profile Fields During Registration

 *  Resolved [floatingpointmatt](https://wordpress.org/support/users/floatingpointmatt/)
 * (@floatingpointmatt)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/validating-custom-profile-fields-during-registration/)
 * Hey everybody,
 * A quick question about validating custom profile fields during the registration
   process…
 * I’ve got fields showing, and in theory capturing based on the code at:
 * [http://wordpress.org/support/topic/howto-custom-registration-fields?replies=6](http://wordpress.org/support/topic/howto-custom-registration-fields?replies=6)
 * Validation on register_post didn’t seem to work though, so I followed through
   the Codex to registration_errors…
 * [http://codex.wordpress.org/Plugin_API/Filter_Reference/registration_errors](http://codex.wordpress.org/Plugin_API/Filter_Reference/registration_errors)
 * Now I am able to interact with errors (which weren’t available during register_post),
   but trying to register throws the following error:
 * PHP Fatal error: Call to a member function get_error_code() on a non-object in…\
   wp-login.php on line 316
 * Trying to trace that error shows that it happens often with plugins that interact
   with registration (apparently Sabre is high on the list), but I get nothing in
   terms of a recommended fix.
 * NOTE: I get the error whether I send things through empty (i.e. all errors on
   required fields) or completely filled in.
 * I’ve confirmed I have a WP_Error object through the body of my validation function,
   and a print_r indicates all should be fine from start to finish (with a few errors
   getting added if appropriate) but it seems like the WP_Error object is getting
   mangled by the time it returns to wp-login.php…
 * Has anybody seen anything on successfully adding and validating profile fields
   for WordPress 3.3.x and up?
 * NOTE: I’d upgrade to 3.4.x but I’d rather fight this battle, then worry about
   plugin compatibilities, etc.
 * ADDITIONAL: I’m also doing this for a stronger integration with the admin than
   a plugin like WP-Members offers (which works, but works differently… and undesirably
   so).
 * Any assistance would be greatly appreciated!
 * Thanks,
 * Matt

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [MG7282](https://wordpress.org/support/users/mgrinshpun/)
 * (@mgrinshpun)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/validating-custom-profile-fields-during-registration/#post-2984406)
 * Did you find a solution for this?
 *  Thread Starter [floatingpointmatt](https://wordpress.org/support/users/floatingpointmatt/)
 * (@floatingpointmatt)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/validating-custom-profile-fields-during-registration/#post-2984407)
 * Actually, I did… though I’m not sure it really registered at the time why…
 * On recent review, the article I was using as a guide uses the following function
   signature:
 * **function check_fields($login, $email, $errors)**
 * However, the API call is actually:
 * **function myplugin_check_fields($errors, $sanitized_user_login, $user_email)**
 * Notice the position of **$errors**…
 * It should be first according to:
 * [http://codex.wordpress.org/Plugin_API/Filter_Reference/registration_errors](http://codex.wordpress.org/Plugin_API/Filter_Reference/registration_errors)
 * Best of luck!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Validating Custom Profile Fields During Registration’ is closed to new
replies.

## Tags

 * [registration form](https://wordpress.org/support/topic-tag/registration-form/)
 * [validation](https://wordpress.org/support/topic-tag/validation/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 2 replies
 * 2 participants
 * Last reply from: [floatingpointmatt](https://wordpress.org/support/users/floatingpointmatt/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/validating-custom-profile-fields-during-registration/#post-2984407)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
