In the example above, we add a new field to JSON output - acf1. The field acf1 will contain everything that can be obtained by get_fields(ID). So, the next time you issue a RESTful call like this:
your JSON result will contain basic fields of the posts , like id, date ,etc. However, every record will contain the acf1 field , too!
RETURN ALL POSTS FOR A SPECIFIC POST TYPE / CPT
By default, WP-API returns 10 records per page. In caase you would like it to return all records, you should set per_page parameter to -1, like in the following code:
Note that the filter is CPT dependent. This filter will be only executed on market CPT.