WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.4k stars 4.16k forks source link

Query Loop: add ability to define (toggleable) custom filters #63804

Open theskinnyghost opened 2 months ago

theskinnyghost commented 2 months ago

What problem does this address?

Currently if we want to add additional filters for the query loop, we need to create our own panel which makes editing a bit confusing as settings are scattered across the inspector. For consistency, it would be great if we could add them to the "Filters" panel and make them available only when the user needs them.

What is your proposed solution?

Add a way for developers to create custom filters which show up on the same panel. image

fabiankaegy commented 2 months ago

Agree this would be super useful! Especially for the Query Loop block. But I know there have been conversations for a while about how custom controls can get added to core panels without needing to register custom slot fill slots all over the place.

CC: @gziolo @Mamaduka Curious if you have made any more discoveries on this since we last spoke.

Also CC: @ryanwelcher since I know you are working on your Advanced Query loop and currently a small refactor of the Settings in the Query Loop sidebar :)

gziolo commented 2 months ago

CC: @gziolo @Mamaduka Curious if you have made any more discoveries on this since we last spoke.

In my opinion, @ntsekouras would have the best insights related to this topic.

ntsekouras commented 1 month ago

Actually I had experimented with this in the past. Ideally there should be a consistent way for panels to do it, and that was the main reason I closed the old PR.

I'd argue though that Query Loop block is a complex one and quite heavily used, so some 'extra' code like a specific slot could be justified, if we don't have the generic solution soon..