-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to create post with ACF field values #338
Comments
im using this wonderful api to update my products too ,
this code snippet will create a new post that support acf fields
elements under fields are the acf fields , and categories is a repeater field :) |
I had exactly the same issue, thank you @gallaouim this worked for me!! |
@gallaouim Does it also apply to regular post type created by CPT UI? |
@fkiller im sorry for the late answer but yes it apply to regular post type created by CPT UI |
@gallaouim, @donnierisk I can't get your code to post data to acf fields when updating a post. Are you guys using the ACF to REST API plugin to register the routes for the fields? |
Hi @peter-mumford Yes I did use that. I don't have the code anymore to check it exactly unfortunately |
When you make an update / create request with WP API you use the word fields instead of acf |
I've implemented this solution as written above by @gallaouim, but it didn't work (custom post is created successfully, but no ACF data is available in it after creation). I have a custom route registered and have used the Has anyone seen any changes to this recently that might have affected this solution? Is this approach still working for others? |
Exactly the same problem here. Did you ever figure this out? |
I'm having this same problem as well. I created a new custom Post Type called "signup" and directed the acf fields to that. I registered the route using:
Then used the 'fields' key but to no avail.
I also tried the 'acf' key and that didn't work either
The acf fields are not updating. |
Hi,
Thanks for this wonderful API,
I am trying to create post with ACF field values, but API creates the post with title and content only and skips the ACF field values. Event I tried to update the ACF field value it throws following error
I referred the #176 as well
Find the code snippet below

Someone help to sort out this. Sample code will be more helpful.
Thanks in advance.
The text was updated successfully, but these errors were encountered: