[wp-trac] [WordPress Trac] #62014: Editor: Add a 'format' parameter to query to enable filtering post formats in the Query Loop block
WordPress Trac
noreply at wordpress.org
Tue Sep 17 17:14:36 UTC 2024
#62014: Editor: Add a 'format' parameter to query to enable filtering post formats
in the Query Loop block
-------------------------------------------------+-------------------------
Reporter: poena | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: 6.7
Component: Editor | Version:
Severity: normal | Resolution:
Keywords: has-patch has-testing-info needs- | Focuses:
testing |
-------------------------------------------------+-------------------------
Comment (by TimothyBlynJacobs):
Yeah right now, each REST API filter is "and"ed with each other. What
makes this a bit more nebulous here potentially is that the Posts
Controller introduced a `tax_relation` query parameter. That can be used
by users to make the taxonomy queries ORed with each other. Right now, the
patch isn't built as a tax query, so the `tax_relation` query parameter
wouldn't apply.
I ''think'' this is the correct way of handling this. Because the API
isn't treating post formats as just another taxonomy, but a specifically
handled flag.
So right now, I believe, if I ran a query of
`/posts?category=5&tag=7&tax_relation=OR&format=audio`, we would return
posts that have (either cat:5 OR tag:7) AND (format=audio). Might be worth
adding a unit test specifically demonstrating this?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62014#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list