Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: registration_errors

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
309      } elseif ( ! is_email( $user_email ) ) {
310           $errors->add( 'invalid_email', __( '<strong>ERROR</strong>: The email address isn&#8217;t correct.' ) );
311           $user_email = '';
312      } elseif ( email_exists( $user_email ) ) {
313           $errors->add( 'email_exists', __( '<strong>ERROR</strong>: This email is already registered, please choose another one.' ) );
314      }
315
316      do_action( 'register_post', $sanitized_user_login, $user_email, $errors );
317
318      $errors = apply_filters( 'registration_errors', $errors, $sanitized_user_login, $user_email );
319
320      if ( $errors->get_error_code() )
321           return $errors;
322
323      $user_pass = wp_generate_password( 12, false);
324      $user_id = wp_create_user( $sanitized_user_login, $user_pass, $user_email );
325      if ( ! $user_id ) {
326           $errors->add( 'registerfail', sprintf( __( '<strong>ERROR</strong>: Couldn&#8217;t register you... please contact the <a href="mailto:%s">webmaster</a> !' ), get_option( 'admin_email' ) ) );
327           return $errors;