• 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.

Viewing 1 replies (of 1 total)
  • How have you registered the function to be triggered by the action? Video Thumbnails uses add_action( 'new_to_publish', 'save_video_thumbnail', 10, 1 ); to call the function save_video_thumbnail() on this event.

Viewing 1 replies (of 1 total)
  • The topic ‘No post thumbnail at the point when new_to_publish is triggered’ is closed to new replies.