acf-to-rest-api icon indicating copy to clipboard operation
acf-to-rest-api copied to clipboard

ACF only showing image ID

Open monckey100 opened this issue 3 years ago • 7 comments

If you select image array or image url it does not change anything, the latest update broke the image content type and now it only shows image id.

monckey100 avatar Mar 02 '22 20:03 monckey100

Upgrading ACF above 5.10.2 broke more than that for us. the v2 API started returning a bunch less data.

tcpriceweber avatar Mar 05 '22 00:03 tcpriceweber

It's not showing the media ID, that would be helpful because you could then reconstruct the path. It is showing the attachment ID. Not even the media ID.

fsfgsagerahgearge avatar Mar 05 '22 11:03 fsfgsagerahgearge

This is happening for ALL attachments! Even files, it's not only images!

fsfgsagerahgearge avatar Mar 05 '22 11:03 fsfgsagerahgearge

Since the last releases ACF default to its light REST API format. You can switch back to the standard format with an URL param (acf_format=standard) or globally with a WordPress filter :

add_filter('acf/settings/rest_api_format', function () { return 'standard'; });

cf. https://www.advancedcustomfields.com/resources/wp-rest-api-integration/#controlling-output-format

rubycon avatar Mar 07 '22 09:03 rubycon

Since the last releases ACF default to its light REST API format. You can switch back to the standard format with an URL param (acf_format=standard) or globally with a WordPress filter :

add_filter('acf/settings/rest_api_format', function () { return 'standard'; });

cf. https://www.advancedcustomfields.com/resources/wp-rest-api-integration/#controlling-output-format

Frames this as an intended feature. Within wordpress however I get the option to select the return value, one of which is URL. Setting this does not return the URL however, it just returns the attachment ID no matter what.

This breaks so many pieces of software relying on return types.

fsfgsagerahgearge avatar Mar 07 '22 15:03 fsfgsagerahgearge

Does this still work? In my case, it's not even working appending ?acf_format=standard at the end of request.

LuLue7775 avatar Oct 16 '22 03:10 LuLue7775

Does this still work? In my case, it's not even working appending ?acf_format=standard at the end of request.

I literally was only able to get this to work by rolling back to an older version...

monckey100 avatar Oct 16 '22 13:10 monckey100