wp-graphql-acf icon indicating copy to clipboard operation
wp-graphql-acf copied to clipboard

Feature Request: Return Value as set in ACF - value, label, or both (Array)

Open heyfletch opened this issue 5 years ago • 2 comments

Was recently getting an array from a radio field. GraphQL returned the values as expected. But ACF has a setting to Return Value with options Value, Label, or Both (Array). Having the ability to return the Label would have facilitated my data needs.

Screenshot for reference:

image

heyfletch avatar Aug 13 '19 22:08 heyfletch

any news about that ? 👯

Small hack before the fix

add_filter('graphql_acf_field_value', function ($value, $field, $root, $id) {
  if($field['key'] == 'MY_FIELD_KEY')
    return $field['choices'][$value];
  return $value;
}, 10, 4);

stephanedemotte avatar May 07 '20 09:05 stephanedemotte

Any progress with that, please?

ljanecek avatar Oct 12 '20 15:10 ljanecek

👋🏻 we're re-building WPGraphQL for ACF over here: https://github.com/wp-graphql/wpgraphql-acf

I've created a new issue in that repo to track this feature request. See: https://github.com/wp-graphql/wpgraphql-acf/issues/105

We'll be archiving this repo in the not-too-distant future, so I'm going to close this issue and we'll track this in the new repo.

Thanks!

jasonbahl avatar Oct 30 '23 19:10 jasonbahl