In other post types, images are often pulled in through image or gallery fields, and then pulled into a vue app via the REST API. For example, a project has an image field of banner_image or gallery.
I've read through numerous issues and made several attempts trying to get this credits field to come through in the project -> banner_image object to no avail.
I've tried an array_walk_recursive with add_filter('acf/rest_api/project/get_fields', 'include_nested_acf_data'); and add_filter('acf/rest_api/attachment/get_fields', 'include_nested_acf_data'); as per the lengthy discussion in #109 which is working to fetch ACF data for other related post types.
I've tried hooking into edit_attachment and acf/save_post
The attachment's direct endpoint does indeed reveal its ACF data but when the image is pulled in through another post type's data, I'm at a complete loss for how to pull its ACF data as well.
--
ACF to REST API Version 3.1.0
ACF to REST API Recursive 1.0.0
ACF 5.8.3
Wordpress 5.2.2
My attachments have an ACF titled
credits
In other post types, images are often pulled in through
image
orgallery
fields, and then pulled into a vue app via the REST API. For example, aproject
has an image field ofbanner_image
orgallery
.I've read through numerous issues and made several attempts trying to get this
credits
field to come through in theproject -> banner_image
object to no avail.I've tried an
array_walk_recursive
withadd_filter('acf/rest_api/project/get_fields', 'include_nested_acf_data');
andadd_filter('acf/rest_api/attachment/get_fields', 'include_nested_acf_data');
as per the lengthy discussion in #109 which is working to fetch ACF data for other related post types.I've tried adding the recursive plugin with the modification and added my
credits
field as recommended here: https://gist.github.com/tremppu/bfcb21b1e681f296edcc9079547865bf via #306I've tried hooking into
edit_attachment
andacf/save_post
The attachment's direct endpoint does indeed reveal its ACF data but when the image is pulled in through another post type's data, I'm at a complete loss for how to pull its ACF data as well.
-- ACF to REST API Version 3.1.0 ACF to REST API Recursive 1.0.0 ACF 5.8.3 Wordpress 5.2.2