From 3432b5d3cfefffaf3791bea100527f67030e7734 Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Mon, 15 Apr 2024 17:57:38 +0200 Subject: [PATCH] remove fields by type instead of key --- src/PaymentMethods/AbstractPaymentMethod.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PaymentMethods/AbstractPaymentMethod.php b/src/PaymentMethods/AbstractPaymentMethod.php index 1b16d1f3..4aaa2576 100644 --- a/src/PaymentMethods/AbstractPaymentMethod.php +++ b/src/PaymentMethods/AbstractPaymentMethod.php @@ -297,9 +297,9 @@ public function defaultSettings(): array { $fields = $this->getAllFormFields(); //remove setting title fields - $fields = array_filter($fields, static function ($key) { - return !is_numeric($key); - }, ARRAY_FILTER_USE_KEY); + $fields = array_filter($fields, static function ($field) { + return isset($field['type']) && $field['type']!== 'title'; + }); //we don't save the default description or title, in case the language changes unset($fields['description']); unset($fields['title']);