最佳答案
默认情况下,ACF 不考虑 REST API 响应中字段的“返回值”选择,但如果您将 acf_format=standard
查询参数添加到请求中,它就会考虑返回值选项。
/wp-json/wp/v2/post?acf_format=standard
https://www.advancedcustomfields.com/resources/wp-rest-api-integration/#controlling-output-format
“此外,如果您希望将所有响应数据的格式默认为标准格式,您可以使用 acf/settings/rest_api_format 过滤器强制执行此操作:”
add_filter( 'acf/settings/rest_api_format', function () {
return 'standard';
} );
关于wordpress - ACF Rest Api - 类别返回值术语对象不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72371060/