wip: abstract field groups

This commit is contained in:
2025-09-25 10:53:28 -04:00
parent 8fbac701f6
commit 69d4c1f34a
11 changed files with 606 additions and 392 deletions

View File

@@ -8,9 +8,9 @@ function ccat_graphql_address_register() {
array(
'description' => 'ACF Extended Pro Address field with optional sub-fields',
'fields' => array(
'address' => array(
'formatted' => array(
'type' => 'String',
'description' => 'The full address',
'description' => 'The full address (formatted)',
),
'name' => array(
'type' => 'String',
@@ -32,7 +32,7 @@ function ccat_graphql_address_register() {
'type' => 'String',
'description' => 'Full state or province name',
),
'stateShort' => array(
'stateCode' => array(
'type' => 'String',
'description' => 'State or province abbreviation',
),
@@ -40,7 +40,7 @@ function ccat_graphql_address_register() {
'type' => 'String',
'description' => 'Full country name',
),
'countryShort' => array(
'countryCode' => array(
'type' => 'String',
'description' => 'Country abbreviation (ISO code)',
),
@@ -103,14 +103,14 @@ function ccat_graphql_address_register_field_type() {
case 'state':
$address_data['state'] = $field_value;
break;
case 'state_short':
$address_data['stateShort'] = $field_value;
case 'state_code':
$address_data['stateCode'] = $field_value;
break;
case 'country':
$address_data['country'] = $field_value;
break;
case 'country_short':
$address_data['countryShort'] = $field_value;
case 'country_code':
$address_data['countryCode'] = $field_value;
break;
case 'post_code':
$address_data['postalCode'] = $field_value;