airesvsg / acf-to-rest-api

Exposes Advanced Custom Fields Endpoints in the WordPress REST API
https://wordpress.org/plugins/acf-to-rest-api/
1.33k stars 111 forks source link

ACF only showing image ID #400

Open monckey100 opened 2 years ago

monckey100 commented 2 years ago

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.

tcpriceweber commented 2 years ago

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

fsfgsagerahgearge commented 2 years ago

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 commented 2 years ago

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

rubycon commented 2 years ago

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

fsfgsagerahgearge commented 2 years ago

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.

LuLue7775 commented 2 years ago

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

monckey100 commented 2 years ago

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...