wp_create_application_password
Action HookDescription
Fires when an application password is created. } }Hook Information
File Location |
wp-includes/class-wp-application-passwords.php
View on GitHub
|
Hook Type | Action |
Line Number | 150 |
Hook Parameters
Type | Name | Description |
---|---|---|
int
|
$user_id
|
The user ID. |
array
|
$new_item
|
{ The details about the created password. |
string
|
$new_password
|
The generated application password in plain text. |
array
|
$args
|
{ Arguments used to create the application password. |
Usage Examples
Basic Usage
<?php
// Hook into wp_create_application_password
add_action('wp_create_application_password', 'my_custom_function', 10, 4);
function my_custom_function($user_id, $new_item, $new_password, $args) {
// Your custom code here
}
Source Code Context
wp-includes/class-wp-application-passwords.php:150
- How this hook is used in WordPress core
<?php
145 *
146 * @type string $name The name of the application password.
147 * @type string $app_id A UUID provided by the application to uniquely identify it.
148 * }
149 */
150 do_action( 'wp_create_application_password', $user_id, $new_item, $new_password, $args );
151
152 return array( $new_password, $new_item );
153 }
154
155 /**
PHP Documentation
<?php
/**
* Fires when an application password is created.
*
* @since 5.6.0
* @since 6.8.0 The hashed password value now uses wp_fast_hash() instead of phpass.
*
* @param int $user_id The user ID.
* @param array $new_item {
* The details about the created password.
*
* @type string $uuid The unique identifier for the application password.
* @type string $app_id A UUID provided by the application to uniquely identify it.
* @type string $name The name of the application password.
* @type string $password A one-way hash of the password.
* @type int $created Unix timestamp of when the password was created.
* @type null $last_used Null.
* @type null $last_ip Null.
* }
* @param string $new_password The generated application password in plain text.
* @param array $args {
* Arguments used to create the application password.
*
* @type string $name The name of the application password.
* @type string $app_id A UUID provided by the application to uniquely identify it.
* }
*/
Quick Info
- Hook Type: Action
- Parameters: 4
- File: wp-includes/class-wp-application-passwords.php
Related Hooks
Related hooks will be displayed here in future updates.