• Good evening,

    We’re developing a plugin as consequence of a client request.
    This plugin just extract the ID from a YouTube video, gets the thumbnail and saves it as a media, linked to the post that is being edited.

    Problem is, the featured image doesn’t show immediately, it does only after we update the post at least twice.

    I’m using WordPress 5.8.2 and Gutenberg editor.

    Any ideas on how can i update manually the page or at least the gutenberg editor to have the featured image display the very first time i fetch it, directly from the plugin we’re developing?

    sorry for any spelling or grammar error, have a good evening.

Viewing 1 replies (of 1 total)
  • Topher

    (@topher1kenobe)

    This is a wild guess, but it’s possible that the Post saves faster than the other code can sideload the image from Youtube and create the Image item. There’s some lag in http requests. Maybe do some tests in your saving?

    If ( the image is downloaded and exists ) { 
      save_post()
    }
Viewing 1 replies (of 1 total)

The topic ‘Featured Image not showing on first update post’ is closed to new replies.