Action hook 'wp_delete_application_password'

in WP Core File wp-includes/class-wp-application-passwords.php at line 423

View Source

wp_delete_application_password

Action Hook
Description
Deletes all application passwords for the given user.

Hook Information

File Location wp-includes/class-wp-application-passwords.php View on GitHub
Hook Type Action
Line Number 423

Hook Parameters

Type Name Description
int $user_id User ID.

Usage Examples

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

function my_custom_function($user_id) {
    // Your custom code here
}

Source Code Context

wp-includes/class-wp-application-passwords.php:423 - How this hook is used in WordPress core
<?php
 418  				return new WP_Error( 'db_error', __( 'Could not delete application passwords.' ) );
 419  			}
 420  
 421  			foreach ( $passwords as $item ) {
 422  				/** This action is documented in wp-includes/class-wp-application-passwords.php */
 423  				do_action( 'wp_delete_application_password', $user_id, $item );
 424  			}
 425  
 426  			return count( $passwords );
 427  		}
 428  

PHP Documentation

<?php
/**
	 * Deletes all application passwords for the given user.
	 *
	 * @since 5.6.0
	 *
	 * @param int $user_id User ID.
	 * @return int|WP_Error The number of passwords that were deleted or a WP_Error on failure.
	 */
Quick Info
  • Hook Type: Action
  • Parameters: 1
  • File: wp-includes/class-wp-application-passwords.php
Related Hooks

Related hooks will be displayed here in future updates.