[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 16:21:19 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 magicroundabout):

 I suspect that the answer to this is no, but given that I found a bug, and
 created a (really pretty simple) patch that fixed the bug for my use case
 (36394.2.diff), could we commit my simple patch for 4.6 (so I don't have
 to re-patch core when v4.6 comes out) and raise a new ticket for the
 rabbit hole of `get_the_content( $post )` issues?

 The downside of this is that `wp_trim_excerpt()` would now take a `$post`
 argument but wouldn't always get the expanded, filters-applied version of
 the content of that post before trimming it.

 Thoughts?

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


More information about the wp-trac mailing list