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