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
194      /**
195       * Filters whether the given user can be authenticated with the provided password.
196       *
197       * @since 2.5.0
198       *
199       * @param WP_User|WP_Error $user     WP_User or WP_Error object if a previous
200       *                                   callback failed authentication.
201       * @param string           $password Password to check against the user.
202       */
203      $user = apply_filters( 'wp_authenticate_user', $user, $password );
204      if ( is_wp_error( $user ) ) {
205           return $user;
206      }
207
208      $valid = wp_check_password( $password, $user->user_pass, $user->ID );
209
210      if ( ! $valid ) {
211           return new WP_Error(
212                'incorrect_password',
 
Line Code
276
277      if ( ! $user ) {
278           return new WP_Error(
279                'invalid_email',
280                __( 'Unknown email address. Check again or try your username.' )
281           );
282      }
283
284      /** This filter is documented in wp-includes/user.php */
285      $user = apply_filters( 'wp_authenticate_user', $user, $password );
286
287      if ( is_wp_error( $user ) ) {
288           return $user;
289      }
290
291      $valid = wp_check_password( $password, $user->user_pass, $user->ID );
292
293      if ( ! $valid ) {
294           return new WP_Error(