3

I am trying to publish a post in WP using rest api. I need some extra field too. So I have installed ACF plugin to insert extra field. After sending the request it returning 201 (post is created) but extra field value remaining empty(not updating).

                data = {
                    "title": (data['title']),
                    "content": (data['full_content']),
                    "author": 1,
                    "status": "draft",
                    "featured_media": get_image_id,
                    "acf" : {
                            "intro": "another try"
                    }
                    
                }
                response = requests.post(url, headers=headers, json=post_data)

Here intro is my custom field. In ACF plugin REST API option is True and in get request acf values showing empty value.So how can I insert extra field value?

altu_faltu
  • 81
  • 5

1 Answers1

0

In your request above, try to use "fields", instead of "acf". See more in this comment.

Paul Isaris
  • 414
  • 4
  • 13