WP_Application_Passwords::get_user_application_password()public staticWP 5.6.0

Gets a user's application password with the given UUID.

Method of the class: WP_Application_Passwords{}

No Hooks.

Return

Array|null. The application password if found, null otherwise.

Usage

$result = WP_Application_Passwords::get_user_application_password( $user_id, $uuid );
$user_id(int) (required)
User ID.
$uuid(string) (required)
The password's UUID.

Changelog

Since 5.6.0 Introduced.

WP_Application_Passwords::get_user_application_password() code WP 6.5.4

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;
}