Make WordPress Core

Opened 2 years ago

Last modified 18 months ago

#54850 new enhancement

New filter for build_query_vars_from_query_block()

Reported by: grapplerulrich's profile grapplerulrich Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.8
Component: Editor Keywords: has-patch
Focuses: Cc:


As raised in Gutenberg #36504 a filter to modify and extend the query for the query block would be helpful.

This would allow developers to add new attributes to the query loop block and then pass them to the query.

Change History (4)

This ticket was mentioned in PR #2185 on WordPress/wordpress-develop by grappler.

2 years ago

  • Keywords has-patch added

To modify the WP_Query args array from the Query block properties

Trac ticket:

This ticket was mentioned in Slack in #core-editor by markhowellsmead. View the logs.

2 years ago

#3 @sc0ttkclark
2 years ago

This would also be helpful for me as I was just looking to extend the functionality of the Query Loop block and found it completely lacking in this particular area for me and other developers to customize the query arguments that the function builds up using the WP_Block object context information.

@ntsekouras commented on PR #2185:

18 months ago

👋 - This filter has landed in core in 6.1, coming from this Gutenberg PR: and uses a different name(query_loop_block_query_vars).

Note: See TracTickets for help on using tickets.