I am trying to return an object with values in the category but ACF only returns an array of keys.
Help?
I am trying to return an object with values in the category but ACF only returns an array of keys.
Help?
ACF doesn't respect the "Return Value" selection of the field in REST API responses by default, but if you add the acf_format=standard query param to your request it then respects the return value option.
/wp-json/wp/v2/post?acf_format=standard
https://www.advancedcustomfields.com/resources/wp-rest-api-integration/#controlling-output-format
"Additionally, if you want to default the format to standard for all response data, you can enforce this by using the acf/settings/rest_api_format filter:"
add_filter( 'acf/settings/rest_api_format', function () {
return 'standard';
} );