Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: check_passwords

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
127           $user->use_ssl = 1;
128
129      $errors = new WP_Error();
130
131      /* checking that username has been typed */
132      if ( $user->user_login == '' )
133           $errors->add( 'user_login', __( '<strong>ERROR</strong>: Please enter a username.' ));
134
135      /* checking the password has been typed twice */
136      do_action_ref_array( 'check_passwords', array ( $user->user_login, & $pass1, & $pass2 ));
137
138      if ( $update ) {
139           if ( empty($pass1) && !empty($pass2) )
140                $errors->add( 'pass', __( '<strong>ERROR</strong>: You entered your new password only once.' ), array( 'form-field' => 'pass1' ) );
141           elseif ( !empty($pass1) && empty($pass2) )
142                $errors->add( 'pass', __( '<strong>ERROR</strong>: You entered your new password only once.' ), array( 'form-field' => 'pass2' ) );
143      } else {
144           if ( empty($pass1) )
145                $errors->add( 'pass', __( '<strong>ERROR</strong>: Please enter your password.' ), array( 'form-field' => 'pass1' ) );