Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_authenticate_user

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
96
97           // Is a user's blog marked as spam?
98           if ( !is_super_admin( $user->ID ) && isset($user->primary_blog) ) {
99                $details = get_blog_details( $user->primary_blog );
100                if ( is_object( $details ) && $details->spam == 1 )
101                     return new WP_Error('blog_suspended', __('Site Suspended.'));
102           }
103      }
104
105      $user = apply_filters('wp_authenticate_user', $user, $password);
106      if ( is_wp_error($user) )
107           return $user;
108
109      if ( !wp_check_password($password, $user->user_pass, $user->ID) )
110           return new WP_Error( 'incorrect_password', sprintf( __( '<strong>ERROR</strong>: The password you entered for the username <strong>%1$s</strong> is incorrect. <a href="%2$s" title="Password Lost and Found">Lost your password</a>?' ),
111           $username, wp_lostpassword_url() ) );
112
113      return $user;
114 }