WP_Application_Passwords::application_name_exists_for_user( int $user_id, string $name )
Checks if application name exists for this user.
Parameters
- $user_id
-
(int) (Required) User ID.
- $name
-
(string) (Required) Application name.
Return
(bool) Whether provided application name exists or not.
Source
File: wp-includes/class-wp-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; }
Changelog
Version | Description |
---|---|
5.7.0 | Introduced. |
© 2003–2021 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_application_passwords/application_name_exists_for_user