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
34a51481
Commit
34a51481
authored
2 years ago
by
Everaldo Matias
Browse files
Options
Download
Email Patches
Plain Diff
Add div on terms of the block Custom Taxonomy
parent
60dce725
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
blocks/custom-taxonomy/custom-taxonomy.php
blocks/custom-taxonomy/custom-taxonomy.php
+7
-2
No files found.
blocks/custom-taxonomy/custom-taxonomy.php
View file @
34a51481
...
...
@@ -65,6 +65,9 @@ function render_block_core_post_terms_2($attributes, $content, $block)
$wrapper_attributes
=
get_block_wrapper_attributes
(
array
(
'class'
=>
$classes
));
$html_array
=
[];
$html
.
=
'<div class="hacklab-custom-taxonomy-block">'
;
foreach
(
$post_terms
as
$term
)
{
// The $term is an object, so we don't need to specify the $taxonomy.
$term_link
=
get_term_link
(
$term
);
...
...
@@ -85,10 +88,12 @@ function render_block_core_post_terms_2($attributes, $content, $block)
}
// We successfully got a link. Print it out.
$html_array
[]
=
'<a clas
e
s="'
.
$class
.
'" href="'
.
esc_url
(
$term_link
)
.
'">'
.
$term
->
name
.
'</a>'
;
$html_array
[]
=
'<a class="'
.
$class
.
'" href="'
.
esc_url
(
$term_link
)
.
'">'
.
$term
->
name
.
'</a>'
;
}
$html
=
implode
(
$separator
,
$html_array
);
$html
.
=
implode
(
$separator
,
$html_array
);
$html
.
=
'</div>'
;
}
return
$html
;
}
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