diff --git a/includes/activitypub/transformer/class-event.php b/includes/activitypub/transformer/class-event.php index 13855b0..7793650 100644 --- a/includes/activitypub/transformer/class-event.php +++ b/includes/activitypub/transformer/class-event.php @@ -226,8 +226,10 @@ abstract class Event extends Post { // Add all category terms. $terms = \get_the_terms( $this->wp_object, $this->wp_taxonomy ); - foreach ( $terms as $term ) { - $categories[] = $term->name; + if ( $terms && ! is_wp_error( $terms ) ) { + foreach ( $terms as $term ) { + $categories[] = $term->name; + } } if ( ! empty( $categories ) ) {