Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Query loop / Post template: Enable post format filter (#64167)
Enables filtering the query loop result by post format. To allow querying a given post format, a new parameter, `format` is added to a new compatibility class called `Gutenberg_REST_Posts_Controller_6_7`, which extends the core class `WP_REST_Posts_Controller`. Query loop block: - Adds a new parameter, `format`, to the `query` attribute in block.json. - Adds a new `FormatControls` that uses a list of supported post formats inside a `FormTokenField`. This control is placed in the `Filters` panel in the block settings sidebar. - Adds a new utility function `gutenberg_add_format_query_vars_to_query_loop_block` to ensure that the Query loop block can pass the new `format` argument correctly to `WP_Query`. This function is hooked into `query_loop_block_query_vars`. Post Template block: The new `format` parameter is passed from the query loop block to the post template block as part of the `query` attribute. --------- Co-authored-by: carolinan <[email protected]> Co-authored-by: Mamaduka <[email protected]> Co-authored-by: youknowriad <[email protected]> Co-authored-by: ntsekouras <[email protected]> Co-authored-by: dmsnell <[email protected]> Co-authored-by: TimothyBJacobs <[email protected]> Co-authored-by: nickbohle <[email protected]> Co-authored-by: SergeyBiryukov <[email protected]> Co-authored-by: justintadlock <[email protected]>
- Loading branch information