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