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

Query Loop: Add custom taxonomies to the Filters options #34977

Closed
ryelle opened this issue Sep 20, 2021 · 11 comments · Fixed by #38063
Closed

Query Loop: Add custom taxonomies to the Filters options #34977

ryelle opened this issue Sep 20, 2021 · 11 comments · Fixed by #38063
Assignees
Labels
[Block] Query Loop Affects the Query Loop Block [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@ryelle
Copy link
Contributor

ryelle commented Sep 20, 2021

What problem does this address?

Currently, you can add a Query Loop block for any post type with REST API support, but the only taxonomies you can use to filter are categories and tags, not custom taxonomies. For example, on WordCamp.org, we have "Speakers", with a custom taxonomy "Speaker Groups". When I add a Query Loop with the Speakers post type, I'd expect the Speakers Group to show up in this Filters section:

Screen Shot 2021-09-20 at 4 28 34 PM

What is your proposed solution?

Rather than just hard-coding categories and tags, and turning them off if they're not supported, show all post-type supported taxonomies.

This was mentioned in #24934 (comment), but it's not clear if anyone is still working on it.

@ryelle ryelle added the [Block] Query Loop Affects the Query Loop Block label Sep 20, 2021
@Mamaduka Mamaduka added the [Type] Enhancement A suggestion for improvement. label Sep 21, 2021
@rmorse
Copy link
Contributor

rmorse commented Oct 12, 2021

There might be some cross over with this ticket: #30706

@psorensen
Copy link

Similar situation as the OP. A lot of our clients rely on custom taxonomies to curate content. Providing any mechanism for devs to extend would be super useful. As a dev, I'd be happy the filter proposed here #36504

@fabiankaegy
Copy link
Member

This is something that I've seen come up again and again on client projects.

I hadn't found this issue then but added a comment about it in this PR that would allow for developers to extend the block manually to get the desired result.
#36504 (comment)

A native Support in core would of course make this even better :)

@aaroncommand
Copy link

This issue came up in one of our client projects today. Specifically we were evaluating use of the Query Loop block to display a custom post type, but like many custom post types it relies on an accompanying custom taxonomy. Without the ability to filter by that taxonomy we are not able to use the block.

#36504 would enable us to address the issue, but support for filtering by any taxonomy which has been associated to the post type feels like something that should just work.

@jeffpaul
Copy link
Member

I'd also love to see this gain some traction as we're looking to add some Block Patterns to a plugin and utilizing the Query Loop block with CPT support would be necessary to have this work as we've planned. For more on that see here: 10up/simple-podcasting#84.

@jessynd
Copy link
Contributor

jessynd commented Jan 3, 2022

I am coming across the same issue with my clients' websites as well and agree that it would be really great for all the related custom taxonomies for a post type to show in the query block. I'd say the vast majority of my clients need this functionality to make full use of the Query Loop block on their websites. I agree with @fabiankaegy, and @aaroncommand and everyone on this thread that this functionality should just work by default rather than require block extensions. (Though simplifying block extensions with #36504 would be great too) Thanks for bringing this forward @ryelle 🥳

@sidewaysdesign
Copy link

+1

Using Query Loop Block for everything is so close, and yet so far. It’s frustrating having to stop for hours/days to hand-code solutions for common, low-level features when Gutenberg and Full-Site Editing are so well advanced. Custom post types should be first-class citizens, period.

@dejliglama
Copy link

Putting my +1 on this feature as well. The Loop block is amazing - just up untill this point:) As of now, I need to hand code or use a different loop-feature plugin to accomplish this.

@ryelle
Copy link
Contributor Author

ryelle commented Apr 28, 2022

This was added in the Gutenberg plugin in version 12.5, so if you have Gutenberg active on your site you should see the custom taxonomy under the Filters heading. If you're not using the plugin, this feature should come out in WordPress 6.0 🙂

Screen Shot 2022-04-28 at 11 18 39 AM

@poof86
Copy link

poof86 commented May 16, 2022

In Gutenberg version 13.2 the tags and categories filter in the Query Loop block stopped working.
Just so you know... hope a fix will be released soon.

An issue has been created

@ntsekouras
Copy link
Contributor

Hey @poof86 ! The PR that implemented custom taxonomies filtering was part of 12.5 release, so it shouldn't be about this issue. We can test/discuss in the new issue you have mentioned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Query Loop Affects the Query Loop Block [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.