[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:03:01 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 achbed):

 I tend to lean more towards adding the `$post` parameter to
 `get_the_content()` as it would bring the function more in line with
 similar functions (see `get_the_title()` and `get_permalink()`).

 This does open a ton of worm cans as we need to ensure that we don't reset
 the query incorrectly and unexpectedly in a place it shouldn't normally
 happen.  We would probably need to add a bunch of tests around this.

 Given the scope of the issue and the timing of the 4.6 release, should we
 punt?

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


More information about the wp-trac mailing list