WP_Application_Passwords::get_user_application_password() WordPress Method
This function is used to get a user's application password. This is useful if you need to get a user's password for a specific application. For example, if you need to get a user's password for their WordPress account, you would use this function. To get a user's application password, you need to pass in the user's ID. You can either pass in the user's ID directly, or you can use the get_current_user_id() function to get the ID of the currently logged in user. Once you have the user's ID, you can call the get_user_application_password() function. This function will return the user's application password as a string. You can then use this password to log in to the application.
WP_Application_Passwords::get_user_application_password( int $user_id, string $uuid ) #
Gets a user’s application password with the given UUID.
Parameters
- $user_id
(int)(Required)User ID.
- $uuid
(string)(Required)The password's UUID.
Return
(array|null) The application password if found, null otherwise.
Source
File: wp-includes/class-wp-application-passwords.php
public static function get_user_application_password( $user_id, $uuid ) { $passwords = static::get_user_application_passwords( $user_id ); foreach ( $passwords as $password ) { if ( $password['uuid'] === $uuid ) { return $password; } } return null; }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
5.6.0 | Introduced. |