Answer the question
In order to leave comments, you need to log in
How to update custom fields in wordpress when automatically creating a post?
I create a post function, add data to it via update_field in custom fields (ACF). The post is published, everything is fine, but custom fields are not displayed until you go into the post yourself and update it. Further, when updating through the field code, everything is fine, only the first time you need to update the post. How to fix it? I think you need to somehow update it after generating the post or something like that
Answer the question
In order to leave comments, you need to log in
Maybe this will help:
support.advancedcustomfields.com/forums/topic/prog...
stackoverflow.com/questions/33419228/insert-new-wo...
It's hard to say anything without seeing your code. There is such a nuance:
That is, if you use $field_name in update_field(), then it will not work. And if $field_key - should work.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question