Make WordPress Core

Opened 13 days ago

Last modified 12 days ago

#49153 new defect (bug)

Undefined Variable Warning

Reported by: tweidman Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords: reporter-feedback has-patch
Focuses: Cc:
PR Number:


Notice: Undefined property: WP_Post::$filter in wp-includes/class-wp-post.php on line 342

The fix is simple change the if statement to:

if ( !empty( $this->filter ) ) {

Attachments (3)

class-wp-post.php (6.3 KB) - added by tweidman 13 days ago.
Fixed version of the file
49153.patch (447 bytes) - added by wpamitkumar 12 days ago.
49153.2.patch (447 bytes) - added by wpamitkumar 12 days ago.

Download all attachments as: .zip

Change History (6)

13 days ago

Fixed version of the file

#1 @SergeyBiryukov
13 days ago

  • Component changed from General to Posts, Post Types
  • Keywords reporter-feedback added

Hi there, welcome to WordPress Trac! Thanks for the report.

  1. Could you provide the steps to reproduce the warning on a clean install?
  2. Does the issue still happen with all plugins disabled and a default theme (Twenty Twenty) activated?

12 days ago

12 days ago

#2 @wpamitkumar
12 days ago

  • Keywords has-patch added

#3 @SergeyBiryukov
12 days ago

Thanks for the patch! I think it would still be preferable to understand the conditions of this notice before making any changes here.

Note: See TracTickets for help on using tickets.