Skip to content

Commit 1855dd3

Browse files
committed
check for empty taxQuery key
1 parent 27b130e commit 1855dd3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/wp-includes/blocks.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2714,9 +2714,10 @@ function build_query_vars_from_query_block( $block, $page ) {
27142714
}
27152715
$query['tax_query'] = array_merge( $query['tax_query'], $tax_query_back_compat );
27162716
}
2717-
$tax_query_input = $block->context['query']['taxQuery'];
2718-
if ( ! empty( $tax_query_input ) && is_array( $tax_query_input ) ) {
2719-
$tax_query = array();
2717+
2718+
if ( ! empty( $block->context['query']['taxQuery'] ) && is_array( $block->context['query']['taxQuery'] ) ) {
2719+
$tax_query_input = $block->context['query']['taxQuery'];
2720+
$tax_query = array();
27202721
// If there are keys other than include/exclude, it's the old
27212722
// format e.g. "taxQuery":{"category":[4]}
27222723
if ( ! empty( array_diff( array_keys( $tax_query_input ), array( 'include', 'exclude' ) ) ) ) {

0 commit comments

Comments
 (0)