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

QTS: fix conflict pages/posts in filter_request #1168

Merged
merged 4 commits into from
May 20, 2022

Conversation

spleen1981
Copy link
Contributor

As the information that query is relevant to a page instead of a post is only included in $wp->matched_query, merge with $query argument must always occur.
If page is identified, name key is removed as it is used to retrieve posts instead.
Posts identification test is moved at the end of the block to avoid other conflicts with more specific tests (e.g. custom post types).

Copy link
Collaborator

@herrvigg herrvigg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good if this fixes the issue with the page but the code is difficult to read. Many questions. Should be rewritten in a clearer way.

@spleen1981
Copy link
Contributor Author

spleen1981 commented May 16, 2022

code is difficult to read
Should be rewritten in a clearer way.

Agreed, but code reflects the strategy to identify the kind of item processed by current query (at least my understanding), which is actully not very linear, plus the need to preserve possible custom additional query vars.
Couldn't came up with anything clearer, but I'm obviously open to changes as long as it works.

Added some clarifications here 3e954f6

@herrvigg herrvigg merged commit 2c1ee34 into master May 20, 2022
@spleen1981 spleen1981 deleted the slugs_fix_page_post_conflict branch May 20, 2022 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants