WordPress.org

Make WordPress Core

Opened 7 weeks ago

Last modified 7 weeks 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:

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

Download all attachments as: .zip

Change History (6)

@tweidman
7 weeks ago

Fixed version of the file

#1 @SergeyBiryukov
7 weeks 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
7 weeks ago

@wpamitkumar
7 weeks ago

#2 @wpamitkumar
7 weeks ago

  • Keywords has-patch added

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