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

#16 - Fixes taxonomy field to work for single or multiple selections #89

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
3 changes: 2 additions & 1 deletion src/class-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,8 @@ protected function register_graphql_field( $type_name, $field_name, $config ) {
'resolve' => function( $root, $args, $context, $info ) use ( $acf_field ) {
$value = $this->get_acf_field_value( $root, $acf_field );
$terms = [];
if ( ! empty( $value ) && is_array( $value ) ) {
if ( ! empty( $value ) ) {
$value = is_array( $value ) ? $value : [ $value ];
foreach ( $value as $term ) {
$terms[] = DataSource::resolve_term_object( (int) $term, $context );
}
Expand Down