Compare commits

...

2 commits

View file

@ -45,23 +45,6 @@ final class The_Events_Calendar extends Event {
$this->tribe_event = \tribe_get_event( $wp_object );
}
/**
* Get tribe category of wp_post
*
* @return string|null tribe category if it exists
*/
public function get_tribe_category() {
// TODO: make it possible that one event can have multiple categories?
// Using cat_slugs isn't the best way to do this, don't know if it's a good idea.
$categories = tribe_get_event_cat_slugs( $this->wp_object->ID );
if ( count( $categories ) === 0 ) {
return null;
}
return $categories[0];
}
/**
* Get status of the tribe event
*
@ -97,16 +80,28 @@ final class The_Events_Calendar extends Event {
* Check if the comments are enabled for the current event.
*/
public function get_comments_enabled(): bool {
return ( 'open' === $this->tribe_event->comment_status ) ? true : false;
return 'open' === $this->tribe_event->comment_status;
}
/**
* Check if the event is an online event.
*/
public function get_is_online(): bool {
if ( class_exists( 'Tribe\Events\Virtual\Event_Meta' ) &&
$this->tribe_event->virtual_event_type &&
Tribe\Events\Virtual\Event_Meta::$value_virtual_event_type === $this->tribe_event->virtual_event_type) {
return true;
}
return false;
}
/**
* Returns language of the event
*/
public function get_in_language(): string {
return $this->get_locale();
}
/**
* Returns the content for the ActivityPub Item with
*