Skip to content

Add applyFilters to the Query Block query. #34201

@TobyOsborne

Description

@TobyOsborne

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 anapplyFilters somewhere that provides access to the Query block attributes, and allows modifying the query variable set in the post-template block (around line 89)

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Block] Query LoopAffects the Query Loop Block[Feature] ExtensibilityThe ability to extend blocks or the editing experience

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions