Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Adds filter to register_graphql_field to enable reusing logic of existing ACF types #288

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/class-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down