[wp-trac] [WordPress Trac] #36934: Use of get_the_excerpt($post) is broken if post has no excerpt and you are inside a loop

WordPress Trac noreply at wordpress.org
Wed Jul 6 00:17:17 UTC 2016


#36934: Use of get_the_excerpt($post) is broken if post has no excerpt and you are
inside a loop
-------------------------------------------------+-------------------------
 Reporter:  magicroundabout                      |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  4.6
Component:  Formatting                           |     Version:  4.5
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing needs-unit-  |     Focuses:  template
  tests                                          |
-------------------------------------------------+-------------------------

Comment (by peterwilsoncc):

 @swissspidy I think this needs to avoid `wp_reset_postdata()` as it is
 possible the global post object isn't from the main query prior to this
 call. On first reading, [attachment:36934b.diff] looks closer to the mark.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36934#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list