From dd1bb21df9cbe96cbeb3ca2a0ceb3dc368d2b836 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Mon, 13 Nov 2023 08:29:23 +0100 Subject: [PATCH] Added array shape to register_extended_field_group --- src/helpers.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/helpers.php b/src/helpers.php index 4073be56..4fe36f6c 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -15,6 +15,7 @@ if (!function_exists('register_extended_field_group')) { /** + * @param array{title: string, fields: array, location: array} $settings * @see https://www.advancedcustomfields.com/resources/register-fields-via-php/#group-settings * @throws \InvalidArgumentException */ @@ -32,9 +33,9 @@ function register_extended_field_group(array $settings): array $settings['style'] ??= 'seamless'; - $settings['fields'] = array_map(fn($field) => $field->get($key), $settings['fields']); + $settings['fields'] = array_map(fn ($field) => $field->get($key), $settings['fields']); - $settings['location'] = array_map(fn($location) => $location->get(), $settings['location']); + $settings['location'] = array_map(fn ($location) => $location->get(), $settings['location']); $settings['key'] = Key::generate($key, 'group');