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