WP_Application_Passwords::hash_passwordpublic staticWP 6.8.0

Hashes a plaintext application password.

Method of the class: WP_Application_Passwords{}

No Hooks.

Returns

String. Hashed password.

Usage

$result = WP_Application_Passwords::hash_password( string $password ): string;
string $password(required)

.

It has the attribute #[\SensitiveParameter], which hides the value of the parameter from logs. It is used to protect sensitive data (for example, passwords). Documentation.

Changelog

Since 6.8.0 Introduced.

WP_Application_Passwords::hash_password() code WP 7.0

public static function hash_password(
	#[\SensitiveParameter]
	string $password
): string {
	return wp_fast_hash( $password );
}