Closed jonas-hoebenreich closed 1 year ago
Thanks for the PR. Are you able to let me know under what conditions I can replicate the problem? Eg does it occur on special pages like 404?
Hi zedzedzed, thanks for replying. Please excuse my monosyllabic PR. The error occurs when using TOC in the sidebar of the Knowledge Base overview page of Basepress (https://wordpress.org/plugins/basepress/). I honestly didn't delve deeper into the underlying reason, I was already satisfied with the fix when the error was no longer generated for every page load. Overall, I don't think it's a bad approach to always look for zero safety. Because there will probably always be some edge cases where $wp_query->post is not defined. Best regards from Munich, Jonas
When using TOC in a widget, post may not always be defined. To avoid a php error the plugin should abort in time.