C
C
CrewCut2016-03-16 17:14:18
WordPress
CrewCut, 2016-03-16 17:14:18

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

1 answer(s)
I
Igor Vorotnev, 2016-03-16
@CrewCut

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 question

Ask a Question

731 491 924 answers to any question