Any help to get me debugging in the right direction is greatly appreciated!
This error has not occurred for me before, so I’m wondering if it was a recent update to WordPress (6.1.1) that might be at issue. It’s happening on 6.1.1 with my plugin code, but my plugin had no such warnings on prior versions.
I am getting the following warnings:
Warning: array_filter() expects parameter 1 to be array, null given in /home/customer/www/davidg472.sg-host.com/public_html/wp-includes/class-wp-query.php on line 3590
Warning: array_map(): Expected parameter 2 to be an array, null given in /home/customer/www/davidg472.sg-host.com/public_html/wp-includes/class-wp-query.php on line 3596
This happens on the Pages page in wp-admin, which is very strange, because my plugin shouldn’t be doing any admin actions that would affect that page.
I looked at the WordPress code mentioned in the warnings, and for some reason, $this->posts is coming up null. I’m seeing all the pages that I would expect, but I also don’t know which post type this warning is coming from. My plugin’s custom post type is populated with posts, but even if it didn’t have any yet, that would be a valid state.
I turned on debugging, but it’s not giving me any errors from any file except class-wp-query.php.
Anyone have any ideas on what could be happening, or where I should look in my code? WordPress hooks that could be getting called on the Pages page that I didn’t realize were called there? I can give you a list of all the hooks I current utilize, if that helps. Just let me know.
