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