Skip to content

Commit

Permalink
remove fields by type instead of key
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaymo committed Apr 15, 2024
1 parent 4f71e10 commit 3432b5d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/PaymentMethods/AbstractPaymentMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down

0 comments on commit 3432b5d

Please sign in to comment.