register_post
Fires when submitting registration form data, before the user is created.
Description
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.
Usage
- To run the hook, copy the example below.
- // run the action
- do_action( 'register_post', $sanitized_user_login, $user_email, $errors );
- The following example is for adding a hook callback.
- // define the register_post callback
- function action_register_post( $sanitized_user_login, $user_email, $errors ) {
- // make action magic happen here...
- };
- // add the action
- add_action( 'register_post', 'action_register_post', 10, 3 );
- To remove a hook callback, use the example below.
- // remove the action
- remove_action( 'register_post', 'action_register_post', 10, 3 );
Defined (1)
The action is defined in the following location(s).
- /wp-includes/user.php
- do_action( 'register_post', $sanitized_user_login, $user_email, $errors );