GC_Application_Passwords::application_name_exists_for_user()

最后更新于:2021-11-26 09:13:19

GC_Application_Passwords::application_name_exists_for_user( int$user_id, string$name)

Checks if application name exists for this user.

参数

$user_id

(int) (Required) User ID.

$name

(string) (Required) Application name.

响应

(bool) Whether provided application name exists or not.

源文件

文件: gc-includes/class-gc-application-passwords.php

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