I've got some custom templates on a custom post type. I have a repeater field where the content is processed on the page template. The processing does not work correctly after importing the data unless the posts are saved manually from the WP admin. All the data appears in the backend correctly and I can't find any changes in the database that seem to be effect how the repeater field is processed. However, the field is not correctly processed by the PHP until it's updated. Anyway idea why this is happening? Is there a way I can simulate clicking update on every post with a script? I've tried using wp_update_post
and wp_publish_post
, but those commands do not seem to have the necessary effect. Thanks!
Asked
Active
Viewed 1,420 times
2

heller_benjamin
- 37
- 1
- 9
1 Answers
-4
It turns out for me that old site I had been moving stuff from had default values for certain custom fields. For whatever reason, those were not moved over. So in my function I just added an if(empty($custom_field){$custom_field="defaultText"}
That solved my issue.

Samyer
- 1,695
- 1
- 8
- 9
-
Also, why is this question not in the Wordpress forum?? – Samyer Apr 11 '17 at 15:28