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

This hook occurs 2 times in this file.

Line Code
171      /**
172       * Filters whether the given user can be authenticated with the provided password.
173       *
174       * @since 2.5.0
175       *
176       * @param WP_User|WP_Error $user     WP_User or WP_Error object if a previous
177       *                                   callback failed authentication.
178       * @param string           $password Password to check against the user.
179       */
180      $user = apply_filters( 'wp_authenticate_user', $user, $password );
181      if ( is_wp_error( $user ) ) {
182           return $user;
183      }
184
185      if ( ! wp_check_password( $password, $user->user_pass, $user->ID ) ) {
186           return new WP_Error(
187                'incorrect_password',
188                sprintf(
189                     /* translators: %s: User name. */
 
Line Code
242
243      if ( ! $user ) {
244           return new WP_Error(
245                'invalid_email',
246                __( 'Unknown email address. Check again or try your username.' )
247           );
248      }
249
250      /** This filter is documented in wp-includes/user.php */
251      $user = apply_filters( 'wp_authenticate_user', $user, $password );
252
253      if ( is_wp_error( $user ) ) {
254           return $user;
255      }
256
257      if ( ! wp_check_password( $password, $user->user_pass, $user->ID ) ) {
258           return new WP_Error(
259                'incorrect_password',
260                sprintf(