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

WordPress Trac noreply at wordpress.org
Tue May 7 02:08:10 UTC 2019


#42814: PHP 7.2 Warning: ...wp-includes/post-template.php on line 284
-------------------------------------------------+-------------------------
 Reporter:  internetwerk                         |       Owner:
                                                 |  boonebgorges
     Type:  defect (bug)                         |      Status:  closed
 Priority:  normal                               |   Milestone:  5.2
Component:  Posts, Post Types                    |     Version:  4.5
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  dev-feedback has-patch 2nd-opinion   |     Focuses:
  php73 has-unit-tests                           |
-------------------------------------------------+-------------------------

Comment (by lucasbustamante):

 As the buddy above mentioned, I have also stumbled upon this while writing
 tests. I was creating a post using a factory and overriding **$GLOBALS[
 'post' ]**.

 Calling **setup_postdata($post->ID)**  fixed it for me. Just saying this
 to help understand in which context this warning might pop up.

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


More information about the wp-trac mailing list