Make WordPress Core

Opened 5 years ago

Last modified 5 years ago

#49153 new defect (bug)

Undefined Variable Warning

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


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 5 years ago.
Fixed version of the file
49153.patch (447 bytes) - added by wpamitkumar 5 years ago.
49153.2.patch (447 bytes) - added by wpamitkumar 5 years ago.

Download all attachments as: .zip

Change History (6)

5 years ago

Fixed version of the file

#1 @SergeyBiryukov
5 years 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?

5 years ago

5 years ago

#2 @wpamitkumar
5 years ago

  • Keywords has-patch added

#3 @SergeyBiryukov
5 years 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.