We are trying to access data from custom fields using the REST API. We can retrieve some, but not all of the data. As you can see from the JSON below, we can retrieve "raw" data from a textfield and a checkbox, for example, but we are missing the "raw" data from "wysiwyg" fields for some reason. Can you explain how to get this data? This is the JSON output for a custom field group called "capture-techniques":
"capture-techniques": {
"display-c-t": {
"type": "checkbox",
"raw": "1"
},
"details": {
"type": "wysiwyg",
"raw": ""
},
"scan-locations-heading": {
"type": "textfield",
"raw": "Photogrammetry Data"
},
"scan-locations": {
"type": "image",
"raw": "",
"attachment_id": null
}
}
Any assistance would be greatly appreciated.
Thank you.
Hello,
I have tried it in a fresh WP installation + the latest version of Toolset plugins, with below steps:
1) Create a custom field group + custom wysiwyg field "details"
2) Follow our document to expose the custom fields in REST API:
Toolset -> Settings page and on Custom Content tab enable the REST API option
https://toolset.com/documentation/programmer-reference/toolset-integration-with-the-rest-api/
3) Create a new post, fill value into the custom wysiwyg field "details"
4) Test the REST API result in frontend, it works fine
I can see the value in wysiwyg field "details" correctly
So the problem you mentioned above is abnormal, please check these:
1) Make sure you are using the latest version of Toolset plugins, you can download them here:
https://toolset.com/account/downloads/
2) In case it is a compatibility problem, please deactivate all other plugins, and switch to WordPress default theme 2022, and test again
If the problem is fixed, activate other plugins/theme one by one, try to locate the problem plugin