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.


Top ↑

Return

(array|null) The application password if found, null otherwise.


Top ↑

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


Top ↑

Changelog

Changelog
VersionDescription
5.6.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.