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
763cfd7d
Commit
763cfd7d
authored
2 years ago
by
tigurio
Browse files
Options
Download
Email Patches
Plain Diff
ajuste de lista
parent
dc9a4932
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
blocks/filter-by-taxonomy/filter-by-taxonomy.php
blocks/filter-by-taxonomy/filter-by-taxonomy.php
+4
-6
No files found.
blocks/filter-by-taxonomy/filter-by-taxonomy.php
View file @
763cfd7d
...
...
@@ -61,24 +61,22 @@ function filter_by_taxonomy_callback( $attributes, $content, $block ) {
// } else {
// $terms_html .= "<li data-taxonomy='{$term->slug}'>Todos</li>";
// }
foreach
(
$terms
as
$term
)
{
$term_link
=
get_term_link
(
$term
);
if
(
isset
(
$_GET
[
'hl_term'
]
)
&&
$term
->
slug
==
$_GET
[
'hl_term'
]
)
{
$terms_html
.
=
"<li data-taxonomy='
{
$term
->
slug
}
' class='active'>
{
$term
->
name
}
</option>"
;
}
else
{
$terms_html
.
=
"<li data-taxonomy='
{
$term
->
slug
}
'
onclick='this.form.submit()
'>
{
$term
->
name
}
</li>"
;
$terms_html
.
=
"<li data-taxonomy='
{
$term
->
slug
}
'
><a href='
{
$term_link
}
'>
{
$term
->
name
}
</
a></
li>"
;
}
}
$html
=
"
<form class='wp-block-hacklab-filter-by-taxonomy'>
<input type='hidden' name='hl_blockid' value='
{
$block_id
}
' />
<label for='hl_term'>
{
$tax_obj
->
label
}
</label>
<ul>
{
$terms_html
}
</ul>
</form>
"
;
}
...
...
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