Log Killer: Attempt to read property “post_type” on null in class-wp-query.php
-
I got the following PHP warning (on PHP 8.0.20), I have no idea what to do but my error_log file is getting extremely filled with this. Any clue please?
“Attempt to read property “post_type” on null in <b>/home/kr/public_html/wp-includes/class-wp-query.php</b> on line 4338 on any URL ending with mysite.com/category/feed/
(feed displays, however the error is at the top of the page)
I’ve searched for that warning message on Google and I can say there’re thousands (no joke) of websites indexed with that warning message in the results.
So, it seems that’s a very common problem.
The warning appears only in /feed/ pages, the mentioned line in php file contains:
return in_array( $post_obj->post_type, (array) $post_types, true );Wordpress version: 6.0.1
- The topic ‘Log Killer: Attempt to read property “post_type” on null in class-wp-query.php’ is closed to new replies.