WP_Application_Passwords::application_name_exists_for_user()public staticWP 5.7.0

Checks if an application password with the given name exists for this user.

{} Это метод класса: WP_Application_Passwords{}

Хуков нет.

Возвращает

true|false. Whether the provided application name exists.

Использование

$result = WP_Application_Passwords::application_name_exists_for_user( $user_id, $name );
$user_id(int) (обязательный)
User ID.
$name(строка) (обязательный)
Application name.

Список изменений

С версии 5.7.0 Введена.

Код WP_Application_Passwords::application_name_exists_for_user() WP 6.0.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;
}