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
384
385      if ( $error ) {
386           /**
387            * Fires when an application password failed to authenticate the user.
388            *
389            * @since 5.6.0
390            *
391            * @param WP_Error $error The authentication error.
392            */
393           do_action( 'application_password_failed_authentication', $error );
394
395           return $error;
396      }
397
398      /*
399       * Strips out anything non-alphanumeric. This is so passwords can be used with
400       * or without spaces to indicate the groupings for readability.
401       *
402       * Generated application passwords are exclusively alphanumeric.
 
Line Code
422            * @param WP_Error $error    The error object.
423            * @param WP_User  $user     The user authenticating.
424            * @param array    $item     The details about the application password.
425            * @param string   $password The raw supplied password.
426            */
427           do_action( 'wp_authenticate_application_password_errors', $error, $user, $item, $password );
428
429           if ( is_wp_error( $error ) && $error->has_errors() ) {
430                /** This action is documented in wp-includes/user.php */
431                do_action( 'application_password_failed_authentication', $error );
432
433                return $error;
434           }
435
436           WP_Application_Passwords::record_application_password_usage( $user->ID, $item['uuid'] );
437
438           /**
439            * Fires after an application password was used for authentication.
440            *
 
Line Code
448           return $user;
449      }
450
451      $error = new WP_Error(
452           'incorrect_password',
453           __( 'The provided password is an invalid application password.' )
454      );
455
456      /** This action is documented in wp-includes/user.php */
457      do_action( 'application_password_failed_authentication', $error );
458
459      return $error;
460 }
461
462 /**
463  * Validates the application password credentials passed via Basic Authentication.
464  *
465  * @since 5.6.0
466  *