Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
open-source
hacklab-blocks
Commits
7d6e408a
Commit
7d6e408a
authored
2 years ago
by
Everaldo Matias
Browse files
Options
Download
Plain Diff
Merge branch 'main' of gitlab.hacklab.com.br:open-source/hacklab-blocks into main
parents
978c336e
e77d83e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
8 deletions
+19
-8
blocks/filter-by-taxonomy/filter-by-taxonomy.php
blocks/filter-by-taxonomy/filter-by-taxonomy.php
+19
-8
No files found.
blocks/filter-by-taxonomy/filter-by-taxonomy.php
View file @
7d6e408a
...
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment