Check if admin password matches userdata.
check_admin_pass( string $password ) : bool
$password (string) (Required) Password.
(bool) This function will return true if the password matches the user's admin password or if the admin's cookie or session is set and is valid.
if (check_admin_pass('SECRET_PASSWORD')) {
//
}