Make WordPress Core

Opened 6 years ago

Closed 5 months ago

#49153 closed defect (bug) (invalid)

Undefined Variable Warning

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

Description

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

Download all attachments as: .zip

Change History (8)

@tweidman
6 years ago

Fixed version of the file

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

@wpamitkumar
6 years ago

@wpamitkumar
6 years ago

#2 @wpamitkumar
6 years ago

  • Keywords has-patch added

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

This ticket was mentioned in Slack in #core by sirlouen. View the logs.


5 months ago

#5 @SirLouen
5 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Given that no instructions have been provided for 6 years now, its time to close this

@wpamitkumar if by any chance you happen to read this, please be open to answering Sergey's inquiries, and I will be happy to get into this and test or review it accordingly.

Note: See TracTickets for help on using tickets.