Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: application_password_failed_authentication

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 3 times in this file.

Line Code
369
370      if ( $error ) {
371           /**
372            * Fires when an application password failed to authenticate the user.
373            *
374            * @since 5.6.0
375            *
376            * @param WP_Error $error The authentication error.
377            */
378           do_action( 'application_password_failed_authentication', $error );
379
380           return $error;
381      }
382
383      /*
384       * Strip out anything non-alphanumeric. This is so passwords can be used with
385       * or without spaces to indicate the groupings for readability.
386       *
387       * Generated application passwords are exclusively alphanumeric.
 
Line Code
407            * @param WP_Error $error    The error object.
408            * @param WP_User  $user     The user authenticating.
409            * @param array    $item     The details about the application password.
410            * @param string   $password The raw supplied password.
411            */
412           do_action( 'wp_authenticate_application_password_errors', $error, $user, $item, $password );
413
414           if ( is_wp_error( $error ) && $error->has_errors() ) {
415                /** This action is documented in wp-includes/user.php */
416                do_action( 'application_password_failed_authentication', $error );
417
418                return $error;
419           }
420
421           WP_Application_Passwords::record_application_password_usage( $user->ID, $item['uuid'] );
422
423           /**
424            * Fires after an application password was used for authentication.
425            *
 
Line Code
433           return $user;
434      }
435
436      $error = new WP_Error(
437           'incorrect_password',
438           __( 'The provided password is an invalid application password.' )
439      );
440
441      /** This action is documented in wp-includes/user.php */
442      do_action( 'application_password_failed_authentication', $error );
443
444      return $error;
445 }
446
447 /**
448  * Validates the application password credentials passed via Basic Authentication.
449  *
450  * @since 5.6.0
451  *