admin管理员组文章数量:1304236
I have few custom fields created by ACF on a custom post type "room".
I use postman and the REST API to try to create a new room with my custom fields.
The Autorization is ok. I success to create my room, but all the custom fields are empty. I'm sending a raw content like this :
{
"title":"Sample ACF field demo",
"status": "publish",
"acf":
{
"title_fields" : "Custom title",
"rent_field" : 100,
}
}
Why, the custom fields stay empty ? I'm doing something wrong ?
Thanks
I have few custom fields created by ACF on a custom post type "room".
I use postman and the REST API to try to create a new room with my custom fields.
The Autorization is ok. I success to create my room, but all the custom fields are empty. I'm sending a raw content like this :
{
"title":"Sample ACF field demo",
"status": "publish",
"acf":
{
"title_fields" : "Custom title",
"rent_field" : 100,
}
}
Why, the custom fields stay empty ? I'm doing something wrong ?
Thanks
Share Improve this question edited Feb 1, 2021 at 19:13 djoo asked Feb 1, 2021 at 19:02 djoodjoo 1577 bronze badges1 Answer
Reset to default 0Found it :
Replace acf by fields
{
"title":"Sample ACF field demo",
"status": "publish",
"fields":
{
"title_fields" : "Custom title",
"rent_field" : 100,
}
}
本文标签: Fill up advanced custom field of a custom post type via API REST POST
版权声明:本文标题:Fill up advanced custom field of a custom post type via API REST POST 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741781230a2397322.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论