Action hook 'wp_authenticate_application_password_errors'

in WP Core File wp-includes/user.php at line 478

View Source

wp_authenticate_application_password_errors

Action Hook
Description
Fires when an application password has been successfully checked as valid. This allows for plugins to add additional constraints to prevent an application password from being used.

Hook Information

File Location wp-includes/user.php View on GitHub
Hook Type Action
Line Number 478

Hook Parameters

Type Name Description
WP_Error $error The error object.
WP_User $user The user authenticating.
array $item The details about the application password.
string $password The raw supplied password.

Usage Examples

Basic Usage
<?php
// Hook into wp_authenticate_application_password_errors
add_action('wp_authenticate_application_password_errors', 'my_custom_function', 10, 4);

function my_custom_function($error, $user, $item, $password) {
    // Your custom code here
}

Source Code Context

wp-includes/user.php:478 - How this hook is used in WordPress core
<?php
 473  		 * @param WP_Error $error    The error object.
 474  		 * @param WP_User  $user     The user authenticating.
 475  		 * @param array    $item     The details about the application password.
 476  		 * @param string   $password The raw supplied password.
 477  		 */
 478  		do_action( 'wp_authenticate_application_password_errors', $error, $user, $item, $password );
 479  
 480  		if ( is_wp_error( $error ) && $error->has_errors() ) {
 481  			/** This action is documented in wp-includes/user.php */
 482  			do_action( 'application_password_failed_authentication', $error );
 483  

PHP Documentation

<?php
/**
		 * Fires when an application password has been successfully checked as valid.
		 *
		 * This allows for plugins to add additional constraints to prevent an application password from being used.
		 *
		 * @since 5.6.0
		 *
		 * @param WP_Error $error    The error object.
		 * @param WP_User  $user     The user authenticating.
		 * @param array    $item     The details about the application password.
		 * @param string   $password The raw supplied password.
		 */
Quick Info
  • Hook Type: Action
  • Parameters: 4
  • File: wp-includes/user.php
Related Hooks

Related hooks will be displayed here in future updates.