[wp-trac] [WordPress Trac] #37729: get_post_thumbnail_id doesn't work in post preview

WordPress Trac noreply at wordpress.org
Fri Aug 19 02:51:50 UTC 2016


#37729: get_post_thumbnail_id doesn't work in post preview
-----------------------------+-----------------------------
 Reporter:  nightcoder       |      Owner:
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Post Thumbnails  |    Version:  4.6
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 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.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37729>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list