WordPress at Your Fingertips
function is not described

WP_Application_Passwords::application_name_exists_for_user() public WP 5.7.0

Checks if application name exists for this user.

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

No Hooks.

Return

true|false. Whether provided application name exists or not.

Usage

$result = WP_Application_Passwords::application_name_exists_for_user( $user_id, $name );
$user_id(int) (required)
User ID.
$name(string) (required)
Application name.

Changelog

Since 5.7.0 Introduced.

Code of WP_Application_Passwords::application_name_exists_for_user() WP 5.8.2

public static function application_name_exists_for_user( $user_id, $name ) {
	$passwords = static::get_user_application_passwords( $user_id );

	foreach ( $passwords as $password ) {
		if ( strtolower( $password['name'] ) === strtolower( $name ) ) {
			return true;
		}
	}

	return false;
}