WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
| Line | Code |
|---|---|
| 338 | if ( $user_email == '' ) { |
| 339 | $errors->add( 'empty_email', __( '<strong>ERROR</strong>: Please type your e-mail address.' ) ); |
| 340 | } elseif ( ! is_email( $user_email ) ) { |
| 341 | $errors->add( 'invalid_email', __( '<strong>ERROR</strong>: The email address isn’t correct.' ) ); |
| 342 | $user_email = ''; |
| 343 | } elseif ( email_exists( $user_email ) ) { |
| 344 | $errors->add( 'email_exists', __( '<strong>ERROR</strong>: This email is already registered, please choose another one.' ) ); |
| 345 | } |
| 346 | |
| 347 | do_action( 'register_post', $sanitized_user_login, $user_email, $errors ); |
| 348 | |
| 349 | $errors = apply_filters( 'registration_errors', $errors, $sanitized_user_login, $user_email ); |
| 350 | |
| 351 | if ( $errors->get_error_code() ) |
| 352 | return $errors; |
| 353 | |
| 354 | $user_pass = wp_generate_password( 12, false); |
| 355 | $user_id = wp_create_user( $sanitized_user_login, $user_pass, $user_email ); |
| 356 | if ( ! $user_id ) { |