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

WordPress Trac noreply at wordpress.org
Mon Nov 5 08:06:07 UTC 2018


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

Comment (by rogerlos):

 Just as a sanity check, as a developer I would "naturally" (ie, I'm
 probably doing it wrong) expect that if I have a legit `post` object in my
 possession, I should be able to call any `get_the_` functions using that
 `post_id` (or by handing the function the `post` object).

 The reason: I want WordPress to apply the filters normally applied to
 post_content to the post my code has grabbed in hopes of "normalizing" my
 function's output to match other content on the site.

 This is also tricky in that `get_the_excerpt` does not fail if there is
 content in `post_excerpt`. I call `get_the_excerpt` often in hopes that I
 get back content even if `post_excerpt` is empty via its "grab some post
 content if excerpt is empty" feature.

 My opinion, worth exactly what you're paying for it, is that there ideally
 should not be any "within the loop" only functions, just like there should
 be no functions which ''only'' `echo` content without option to get back
 the results...

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


More information about the wp-trac mailing list