[wp-trac] [WordPress Trac] #52198: [PHP 8.0] Undefined property: stdClass::$post_status on /wp-admin/includes/misc.php

WordPress Trac noreply at wordpress.org
Fri Jan 1 04:20:55 UTC 2021


#52198: [PHP 8.0] Undefined property: stdClass::$post_status on /wp-
admin/includes/misc.php
-------------------------------+------------------------------
 Reporter:  GwynethLlewelyn    |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Posts, Post Types  |     Version:  5.6
 Severity:  trivial            |  Resolution:
 Keywords:                     |     Focuses:
-------------------------------+------------------------------

Comment (by ayeshrajans):

 Hi @GwynethLlewelyn,
 Welcome to WordPress Trac, and I wish you a happy new year!

 You are right, the warning is related to PHP 8, which was previously a
 notice, and it is possible that your previous configuration options was
 not logging/showing those notices (although PHP was configured to show
 notices by default; just not strict and deprecation notices).

 Could you provide a stack trace of the warning message?
 debug_print_backtrace() output or an Xdebug output will do. Instead of
 fixing this when it is used, I think a more appropriate fix would be to
 fix it in upstream, where the post is constructed to make sure
 `post_status` is correctly populated.

 Cheers.

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


More information about the wp-trac mailing list