Backport from WordPress core: Improvements for the post format query loop filter #66037
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What? Why? How?
This pull request copies changes that were made in WordPress core in WordPress/wordpress-develop#7314 The pull request that added the PHP changes related to #64167
AND
relation
key when a user queries for both a format and a taxonomy.Testing Instructions
Confirm that there are no issues and no functional changes when using the post format filter with and without the plugin active, using WordPress 6.7 Beta.
To test the functionality:
Enable post formats in a theme by adding the theme support. Example:
Create a new category.
Create a new post with a post format and assign it to the category.
Create a second post with the same post format, without the category.
Select or insert a query loop block.
In the settings sidebar for the query loop, select "custom".
Locate and open the Filter panel.
Enable the format filter, and enter the name of the format you assigned to your posts.
Save
Confirm that the two posts are showing in the query loop in the editor and front.
Go back to the filter panel and enable the taxonomy filter.
Insert the category you assigned to one of the posts.
Confirm that only the post that has both the category and the format shows in the query loop in the editor and front.