I realize that ACF doesn’t natively support the REST API, but I had this same problem with 2 different ACF REST plugins (times’ acf-to-wp-api and airesvsg’s acf-to-rest-api , and am not sure if it’s on the ACF side of things, or how the plugins are parsing ACF data.
The basic problem is that all of my fields which are in clone groups are getting duplicated in the REST API, under an object named after the clone group. I’ll also put the code below.
In the image above, I have a set of fields in a clone field called “fundraising_clone_group”. In the REST JSON, those fields are shown within an object named after the clone group (so acf.fundraising_clone_group.project_total_cost
), but also flattened, at the acf root key: (e.g. acf.project_total_cost
).
Has anyone else had this problem? I’m wondering if it’s something that should be fixed on the ACF to REST plugin side, or within ACF itself.
"acf": {
"fundraising_menu": "No",
"include_in_insight": "",
"test_date": "15/09/2016",
"test_text": "<p>Just some test text</p>\n",
"project_total_cost": "10",
"project_total_match": "20",
"fundraising_total_goal": "30",
"funding_private_by_year": false,
"funding_public_by_year": false,
"funding_impact_by_year": false,
"funding_notes": "<p>Funding notes go here</p>\n",
"budget_notes": "<p>Budget notes go here.</p>\n",
"fundraising_clone_group": {
"project_total_cost": "10",
"project_total_match": "20",
"fundraising_total_goal": "30",
"funding_private_by_year": false,
"funding_public_by_year": false,
"funding_impact_by_year": false,
"funding_notes": "<p>Funding notes go here</p>\n",
"budget_notes": "<p>Budget notes go here.</p>\n"
},