From 5db6aab444befb00d3bc8d2f0124c9ec7ab70376 Mon Sep 17 00:00:00 2001 From: Thalles Date: Mon, 23 Aug 2021 15:39:53 -0300 Subject: [PATCH] adds new filter to acf_type in register_graphql_field --- src/class-config.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/class-config.php b/src/class-config.php index 927f2b3..32732f2 100644 --- a/src/class-config.php +++ b/src/class-config.php @@ -540,6 +540,14 @@ protected function register_graphql_field( string $type_name, string $field_name return false; } + /** + * filter the acf_type variable to enable custom field types to reuse the logic of existing ones in the switch + * + * @param string $acf_type The original name of the ACF type for the field + * @param array $config The GraphQL configuration of the field. + */ + $acf_type = apply_filters('wpgraphql_acf_register_graphql_field_overwriting_type', $acf_type, $config); + /** * filter the field config for custom field types *