[wp-trac] [WordPress Trac] #47824: get_the_content() still causes a PHP warning outside of the loop

WordPress Trac noreply at wordpress.org
Sun Jun 21 10:27:39 UTC 2020


#47824: get_the_content() still causes a PHP warning outside of the loop
--------------------------------------------+-----------------------------
 Reporter:  SergeyBiryukov                  |       Owner:  SergeyBiryukov
     Type:  defect (bug)                    |      Status:  reopened
 Priority:  normal                          |   Milestone:  5.5
Component:  Posts, Post Types               |     Version:  5.2
 Severity:  normal                          |  Resolution:
 Keywords:  has-patch has-unit-tests early  |     Focuses:
--------------------------------------------+-----------------------------

Comment (by SergeyBiryukov):

 Just noting that the latest patch has the same test failure (comment:8) as
 the one that was committed in [46079].

 See #24330 for some history on that test. The test description says:
 > `setup_postdata( $a_post )` followed by `the_content()` in a loop that
 does not update `global $post` should use the content of `$a_post` rather
 then the global post.

 Going to try a bit different approach here, commit incoming.

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


More information about the wp-trac mailing list