Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent PHP warning reading property on null in WP_Query::is_singular() #3142

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from

Conversation

Tabrisrp
Copy link

@Tabrisrp Tabrisrp commented Aug 26, 2022

get_queried_object() can return null, but there was no check for its value before trying to read the post_type property from the value.

Trac ticket: https://core.trac.wordpress.org/ticket/56188 + https://core.trac.wordpress.org/ticket/29660


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@jrfnl
Copy link
Member

jrfnl commented Sep 6, 2022

Please add a test covering this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants