[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
Thu Jul 7 16:32:10 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 swissspidy):

 @magicroundabout [attachment:36394.2.diff] is not enough and shouldn't be
 committed for the reasons outlined above. It only solves half of the
 problems.

 If this is not fixed properly, we might cause more harm than good, so we
 need to think this through thoroughly.

 > Let's try to get this resolved permanently once.

 Absolutely. #10984 aims to make some changes to `get_the_content()` too,
 so we might need to do an overhaul of that function anyway. Being able to
 pass a specific `$post` to it makes sense.

 Apart from that, [attachment:36934b.diff] might be a solution, but without
 unit tests soon this won't make it into 4.6. I don't have much time at the
 moment, so some help would be appreciated. Otherwise this is a candidate
 for 4.7-early.

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


More information about the wp-trac mailing list