Commit 763cfd7d authored by tigurio's avatar tigurio
Browse files

ajuste de lista

parent dc9a4932
......@@ -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>
";
}
......
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