[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
Sun Sep 4 20:23:24 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:  swissspidy
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  4.7
Component:  Formatting                           |     Version:  4.5
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing needs-unit-  |     Focuses:  template
  tests 4.7-early                                |
-------------------------------------------------+-------------------------

Comment (by swissspidy):

 [attachment:36934.diff] is an improved version of
 [attachment:36934a.diff].

 Main changes:

 * Adds an `$args` parameter to `get_the_content()` to make it more future
 proof.
 * Gets rid of the `$pages` and `$multipage` globals by moving logic to
 `WP_Post`.
 * Adds a test provided by @iandunn in #37519.

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


More information about the wp-trac mailing list