Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#37729 closed defect (bug) (duplicate)

get_post_thumbnail_id doesn't work in post preview

Reported by: nightcoder's profile nightcoder Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.6
Component: Post Thumbnails Keywords:
Focuses: Cc:

Description

The code returns the page/page's featured image id for all additional loops in the preview mode.

get_post_thumbnail_id( $post->ID )

It is pretty obvious when you click previewing a WooCommerce product, the "Related Products" thumbnails, WooCommerce related widgets, all of them will display the post's thumbnail.

If you remove the

_thumbnail_id=

part of the preview url, it works properly.

Attachments (1)

woo-single-page-preview.png (147.9 KB) - added by nightcoder 8 years ago.
WooCommere preview page

Download all attachments as: .zip

Change History (3)

@nightcoder
8 years ago

WooCommere preview page

#1 @joemcgill
8 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Hi @nightcoder,

Thanks for the report. This is a duplicate of #37697, which has a patch that should address the problem. Please feel free to jump in on that ticket and test the latest patch, if you are able.

#2 @nightcoder
8 years ago

Hi @joemcgill, Thank you for the fast reply. I'll do that!

Note: See TracTickets for help on using tickets.