WP-JSON-API-ACF icon indicating copy to clipboard operation
WP-JSON-API-ACF copied to clipboard

Attachments: Include fields in acf-gallery items and generically

Open mhrisse opened this issue 11 years ago • 1 comments

@PanManAms ,

following up on my last PR, I am wondering how we can explain to ACF that it is a great idea to include the ACF fields strapped to an attachment also within a acf-gallery field (and even a acf-gallery field nested in a flexible content field).

Example:

https://www.evernote.com/shard/s97/sh/d31acdac-021f-4041-9ec4-df63c10b12d3/60dc0303002cf1b1209cf2600daf309c

Ideally we find a generic solution that takes care of that for all kinds of nesting. Any ideas appreciated.

mhrisse avatar Dec 05 '14 12:12 mhrisse

Hi @mhrisse

This could be achieved by hooking into the acf/format_value/type=gallery filter (http://www.advancedcustomfields.com/resources/acfformat_value/).

This filter will allow you to customize the returned data from ACF and you can load in the extra custom fields to the $value array

elliotcondon avatar Jan 07 '15 07:01 elliotcondon