From b419bdefc8872a62e411b6b78f6c2adb5744adf8 Mon Sep 17 00:00:00 2001 From: Jason Bahl Date: Wed, 13 Nov 2019 11:33:24 -0700 Subject: [PATCH] - Fixes taxonomy field to work for single or multiple selections --- src/class-config.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/class-config.php b/src/class-config.php index dca8008..1e16126 100644 --- a/src/class-config.php +++ b/src/class-config.php @@ -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 ); }