How to refresh thumbnail for featured post after using update_post_meta()
-
I have a Guttenberg block that takes an image (much like the image block). When it is updated or added I am trying to change the featured image to that. Unrelated, but note that I am using ACF plugin for this.
I am using
update_post_meta($post_id, '_thumbnail_id', $value)
when the state of that ACF image block is updated. I think it is working as intended and updating the featured image field properly. But the issue is that the thumbnail isn’t refreshing until it is saved or posted or updated. While it is good enough for the most part. Is there a function to refresh the featured image section in post edit mode? Or is there a better way to change the featured image from an editor?set_post_thumbnail
doesn’t seem a good idea here.
- The topic ‘How to refresh thumbnail for featured post after using update_post_meta()’ is closed to new replies.