How to expose all the ACF fields to Wordpress REST API in both pages and custom postypes
问题 I want to expose all the ACF fields that belong to a page or custom post type to the WordPress REST API in order to do some API calls through javascript. The final expected result would be all the ACF fields inside an ACF object that you can easily access. 回答1: Through the following code, you will be able to expose page and your custom postypes ACF fields in the wordpress REST API and access them inside the ACF object. You can obviously customise the postypes to exclude or to include in the