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