Question

I try to insert around 2000 video-posts into WP. There is a custom field in the theme for the video-url, so I add the video-url to the post meta data with the corresponding field name. ACF seems not to be used by this theme (Edge, Journo).

This meta data shows up correctly in that field in the backend, however not in the frontend until I hit the update button for every post. After hitting the update button, everything works perfectly.

I tried so far:

  • wp_insert_post with a postarr containing 'meta_input'
  • wp_insert_post followed by add_post_meta
  • additional update_post_meta
  • additional wp_update_post
  • additional update_field
  • different versions of creating the post as a draft and then use wp_publish_post at different times

Does anyone know which functions excactly are triggered by the update button? Or other ideas?

Thanks in advance!

Was it helpful?

Solution

Thanks for your answers! Maybe I was a bit unclear, but I don't use ACF, it is just a field that comes with the theme.

However, this question and answers helped to find the problem: https://stackoverflow.com/questions/34018588/wordpress-add-post-meta-data-doesnt-display-on-page-until-post-is-manually

My WP metadata table entry was incomplete after creating a post programatically, the theme required another field. Saving the post again through the UI fixed that.

Using a plugin to display the meta data I compared the post's meta data after inserting the post and after hitting the update button, so I identified the missing value in the meta data..!

Hope this helps also for others with a similar issue!

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top