1

I try to use wordpress API to build my back-office more easy. For this I must make relation between CPT UI post. I use the ACF and ACF recursive plugin for help me in this. But in the json 'http://localhost:10018/wp-json/wp/v2/plays' for example, i don't have the custom field ACF in my relation...

In this example i linked roles to the play and i want to have the ACF field for this item from staff post type.

enter image description here

I tried all the solutions in this topic : https://github.com/airesvsg/acf-to-rest-api/issues/223 But nothings happen...

Any idea ?

1 Answer 1

0

Depending on your setup, one of these should work now days. Seems to be a built in feature.

https://example.com/wp/?rest_route=/wp/v2/posts&_fields=title,acf

https://example.com/wp-json/wp/v2/posts?_fields=title,acf

The important bit being, adding acf to the list of fields and you should get an array of all the acf fields.

There is more info here about which approach above might be appropriate for your situation.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.