Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: register_post

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
1683      if ( $user_email == '' ) {
1684           $errors->add( 'empty_email', __( '<strong>ERROR</strong>: Please type your e-mail address.' ) );
1685      } elseif ( ! is_email( $user_email ) ) {
1686           $errors->add( 'invalid_email', __( '<strong>ERROR</strong>: The email address isn&#8217;t correct.' ) );
1687           $user_email = '';
1688      } elseif ( email_exists( $user_email ) ) {
1689           $errors->add( 'email_exists', __( '<strong>ERROR</strong>: This email is already registered, please choose another one.' ) );
1690      }
1691
1692      do_action( 'register_post', $sanitized_user_login, $user_email, $errors );
1693
1694      $errors = apply_filters( 'registration_errors', $errors, $sanitized_user_login, $user_email );
1695
1696      if ( $errors->get_error_code() )
1697           return $errors;
1698
1699      $user_pass = wp_generate_password( 12, false );
1700      $user_id = wp_create_user( $sanitized_user_login, $user_pass, $user_email );
1701      if ( ! $user_id || is_wp_error( $user_id ) ) {