Add applyFilters to the Query Block query. #34201
Labels
[Block] Query Loop
Affects the Query Loop Block
[Feature] Extensibility
The ability to extend blocks or the editing experience
What problem does this address?
Currently, there doesn't seem to be a way to modify the Query Block query (for the preview in the block editor).
For example, I'd like to create a custom attribute that modifies the query to show different items.
On the frontend this is easily done through pre_get_posts, but I'm having a hard time reflecting it in the block editors preview.
What is your proposed solution?
Add an
applyFilters
somewhere that provides access to the Query block attributes, and allows modifying the query variable set in the post-template block (around line 89)The text was updated successfully, but these errors were encountered: