[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
Tue Jan 5 21:56:04 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:  php8 reporter-feedback  |     Focuses:
------------------------------------+------------------------------
Changes (by SergeyBiryukov):

 * keywords:  php8 => php8 reporter-feedback


Comment:

 Hi there, thanks for testing WordPress with PHP 8.0!

 Does the issue still happen with all plugins disabled and a default theme
 (Twenty Twenty-One) activated?

 The warning comes from the
 `_wp_privacy_settings_filter_draft_page_titles()` function, which is
 attached to the `list_pages` action in the admin, called from
 `Walker_PageDropdown::start_el()`. The action is supposed to always
 receive a valid page data object a its second argument, so it looks like
 some plugin or theme constructs an object with some properties missing, or
 uses the `list_pages` filter incorrectly, which seems like a developer
 error.

 I don't think we should hide the warning in this case, as that would make
 debugging harder.

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


More information about the wp-trac mailing list