ACF attachment custom field in rest response

by fefe   Last Updated January 21, 2019 23:08 PM

I created an extra select option ACF field for media uploader and I would like to retrieve the associated values in Gutenberg MediaUploader onSelect.

enter image description here Is there a workaround for this case?

Answers 1

Check out ACF to REST API -

You can optionally turn on/off which fields you want to enable.

// Enable the option show in rest
add_filter( 'acf/rest_api/field_settings/show_in_rest', '__return_true' );

// Enable the option edit in rest
add_filter( 'acf/rest_api/field_settings/edit_in_rest', '__return_true' );
Ryan DiMascio
Ryan DiMascio
January 21, 2019 22:30 PM

Related Questions

Creating Gutenberg Block with ACF programmatically

Updated April 16, 2019 19:08 PM