Source View: lostpassword_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.

  • Action hooks look like this: do_action( "hook_name" )
  • Filter hooks look like this: apply_filters( "hook_name", "what_to_filter" ).

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
89      $user_login = '';
90      $user_pass = '';
91
92      if ( $_POST ) {
93           if ( empty( $_POST['user_login'] ) )
94                $errors['user_login'] = __('<strong>ERROR</strong>: The username field is empty.');
95           if ( empty( $_POST['user_email'] ) )
96                $errors['user_email'] = __('<strong>ERROR</strong>: The e-mail field is empty.');
97
98           do_action('lostpassword_post');
99
100           if ( empty( $errors ) ) {
101                $user_data = get_userdatabylogin(trim($_POST['user_login']));
102                // redefining user_login ensures we return the right case in the email
103                $user_login = $user_data->user_login;
104                $user_email = $user_data->user_email;
105
106                if (!$user_email || $user_email != $_POST['user_email']) {
107                     $errors['invalidcombo'] = __('<strong>ERROR</strong>: Invalid username / e-mail combination.');