No post thumbnail at the point when new_to_publish is triggered
-
Hi,
I am writing a simple plugin that sends an email to a couple of users whenever a new post is added. The content of the email is the post that was just added.
It’s seems that at the point where the new_to_publish hook is triggered, get_the_post_thumbnail doesn’t return the thumbnail image. It doesn’t return anything in fact.
However if I run the exact same code manually after the post has been published (by clicking a test button I made), the thumbnail is returned.
It seems that the posts thumbnail is added at some point after the new_to_publish hook is triggered.
Is there a way to get the thumbnail when the post is being published?
Or is there a better action I can hook into that will be triggered after the posts thumbnail is added?
Thanks.
- The topic ‘No post thumbnail at the point when new_to_publish is triggered’ is closed to new replies.