Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Replace gutenberg_build_query_vars_from_query_block filter with query_loop_block_query_vars #7078

Merged
merged 1 commit into from
Sep 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/BlockTypes/ProductQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected function initialize() {
/**
* Remove the query block filter and parse the custom query
*
* This function is supposed to be called by the `gutenberg_build_query_vars_from_query_block`
* This function is supposed to be called by the `query_loop_block_query_vars`
* filter. It de-registers the filter to make sure it runs only once and doesn't end
* up hi-jacking future Query Loop blocks.
*
Expand All @@ -51,7 +51,7 @@ protected function initialize() {
*/
public function get_query_by_attributes_once( $query ) {
remove_filter(
'gutenberg_build_query_vars_from_query_block',
'query_loop_block_query_vars',
array( $this, 'get_query_by_attributes_once' ),
10
);
Expand All @@ -73,7 +73,7 @@ public function update_query( $pre_render, $parsed_block ) {
$this->parsed_block = $parsed_block;

add_filter(
'gutenberg_build_query_vars_from_query_block',
'query_loop_block_query_vars',
array( $this, 'get_query_by_attributes_once' ),
10,
1
Expand Down