Commit 7d6e408a authored by Everaldo Matias's avatar Everaldo Matias
Browse files

Merge branch 'main' of gitlab.hacklab.com.br:open-source/hacklab-blocks into main

parents 978c336e e77d83e9
......@@ -62,15 +62,26 @@ function filter_by_taxonomy_pre_get_posts( $query ) {
return;
}
$query->set( 'tax_query', array(
'tax_query' => array(
$tax_query = $query->get( 'tax_query' );
if( empty( $tax_query ) ) {
$query->set( 'tax_query',
array(
'taxonomy' => $attributes[ 'taxonomy' ],
'field' => 'slug',
'terms' => esc_textarea( $_GET[ 'hl_term'] ),
),
),
) );
array(
'taxonomy' => $attributes[ 'taxonomy' ],
'field' => 'slug',
'terms' => esc_textarea( $_GET[ 'hl_term'] ),
),
)
);
} else {
$tax_query[] = array(
'taxonomy' => $attributes[ 'taxonomy' ],
'field' => 'slug',
'terms' => esc_textarea( $_GET[ 'hl_term'] ),
);
$query->set( 'tax_query', $tax_query );
}
return $query;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment