[wp-trac] [WordPress Trac] #42814: PHP 7.2 Warning: ...wp-includes/post-template.php on line 284

WordPress Trac noreply at wordpress.org
Fri Jan 12 07:16:53 UTC 2018


#42814: PHP 7.2 Warning: ...wp-includes/post-template.php on line 284
--------------------------+------------------------------
 Reporter:  internetwerk  |       Owner:
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Formatting    |     Version:  4.5
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+------------------------------

Comment (by kraftbj):

 That's fair.

 So yes, one thing that needs to happen is for `get_the_content` to work
 outside the loop.

 Another is, specific to the excerpt, Core incompletely adding support for
 `get_the_excerpt` working outside the loop, which my patch addresses
 (could say incompletely since `get_the_content($post)` would be ultimately
 the best).

 Not sure if it is best to conflate both into this ticket or break them out
 to separate issues. At least with the excerpt issue, it is truly a bug
 (should have been done in 4.5) while `get_the_content` never intended to
 work outside the loop, so is more of an enhancement.

 By itself, the excerpt patch not using processed content should be fine in
 the majority of cases, with the major exception of when the excerpt length
 is longer than the content before a more/nextpage jump when getting the
 excerpt outside of the loop, which would have previously returned the
 wrong excerpt (I think), since wp_trim_excerpt would only be acting on the
 global.

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


More information about the wp-trac mailing list