WordPress at Your Fingertips
function is not described

WP_Application_Passwords::get_user_application_passwords() public WP 5.6.0

Gets a user's application passwords.

{} It's a method of the class: WP_Application_Passwords{}

No Hooks.

Return

Array. The list of app passwords.

Usage

$result = WP_Application_Passwords::get_user_application_passwords( $user_id );
$user_id(int) (required)
User ID.

Changelog

Since 5.6.0 Introduced.

Code of WP_Application_Passwords::get_user_application_passwords() WP 5.8.2

public static function get_user_application_passwords( $user_id ) {
	$passwords = get_user_meta( $user_id, static::USERMETA_KEY_APPLICATION_PASSWORDS, true );

	if ( ! is_array( $passwords ) ) {
		return array();
	}

	$save = false;

	foreach ( $passwords as $i => $password ) {
		if ( ! isset( $password['uuid'] ) ) {
			$passwords[ $i ]['uuid'] = wp_generate_uuid4();
			$save                    = true;
		}
	}

	if ( $save ) {
		static::set_user_application_passwords( $user_id, $passwords );
	}

	return $passwords;
}