[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:34:50 UTC 2020


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

 * status:  reopened => closed
 * resolution:   => fixed


Comment:

 In [changeset:"48114" 48114]:
 {{{
 #!CommitTicketReference repository="" revision="48114"
 Posts, Post Types: Avoid a PHP warning when `get_the_content()` is called
 outside of the loop.

 This ensures that `$pages` and other globals are only used after they have
 been set up in `setup_postdata()`.

 Follow-up to [44941].

 Props tessawatkinsllc, dontdream, spacedmonkey, squarecandy,
 davidbaumwald, SergeyBiryukov.
 Fixes #47824. See #42814.
 }}}

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


More information about the wp-trac mailing list