fix format_categories for empty term list
Some checks failed
Some checks failed
This commit is contained in:
parent
f76fa57665
commit
3f7f996e10
1 changed files with 4 additions and 2 deletions
|
@ -226,8 +226,10 @@ abstract class Event extends Post {
|
||||||
|
|
||||||
// Add all category terms.
|
// Add all category terms.
|
||||||
$terms = \get_the_terms( $this->wp_object, $this->wp_taxonomy );
|
$terms = \get_the_terms( $this->wp_object, $this->wp_taxonomy );
|
||||||
foreach ( $terms as $term ) {
|
if ( $terms && ! is_wp_error( $terms ) ) {
|
||||||
$categories[] = $term->name;
|
foreach ( $terms as $term ) {
|
||||||
|
$categories[] = $term->name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! empty( $categories ) ) {
|
if ( ! empty( $categories ) ) {
|
||||||
|
|
Loading…
Reference in a new issue