Fires when submitting registration form data, before the user is created.


do_action( 'register_post', (string) $sanitized_user_login, (string) $user_email, (WP_Error) $errors ); 

Parameters (3)

0. $sanitized_user_login (string)
The submitted username after being sanitized.
1. $user_email (string)
The submitted email.
2. $errors (WP_Error)
Contains any errors with submitted username and email, e.g., an empty field, an invalid username or email, or an existing username or email.


To run the hook, copy the example below.
  1. // run the action 
  2. do_action( 'register_post', $sanitized_user_login, $user_email, $errors ); 
The following example is for adding a hook callback.
  1. // define the register_post callback 
  2. function action_register_post( $sanitized_user_login, $user_email, $errors ) { 
  3. // make action magic happen here... 
  4. }; 
  6. // add the action 
  7. add_action( 'register_post', 'action_register_post', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( 'register_post', 'action_register_post', 10, 3 ); 

Defined (1)

The action is defined in the following location(s).

  1. do_action( 'register_post', $sanitized_user_login, $user_email, $errors );