Compare commits
No commits in common. "49901e9648d97ec18014c5f3f8e0f22ea3dbf9a3" and "4e2c1fb23a3321c9d900e1faf520c2c2ede64445" have entirely different histories.
49901e9648
...
4e2c1fb23a
1 changed files with 18 additions and 13 deletions
|
@ -45,6 +45,23 @@ final class The_Events_Calendar extends Event {
|
||||||
$this->tribe_event = \tribe_get_event( $wp_object );
|
$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
|
* Get status of the tribe event
|
||||||
*
|
*
|
||||||
|
@ -80,28 +97,16 @@ final class The_Events_Calendar extends Event {
|
||||||
* Check if the comments are enabled for the current event.
|
* Check if the comments are enabled for the current event.
|
||||||
*/
|
*/
|
||||||
public function get_comments_enabled(): bool {
|
public function get_comments_enabled(): bool {
|
||||||
return 'open' === $this->tribe_event->comment_status;
|
return ( 'open' === $this->tribe_event->comment_status ) ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the event is an online event.
|
* Check if the event is an online event.
|
||||||
*/
|
*/
|
||||||
public function get_is_online(): bool {
|
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;
|
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
|
* Returns the content for the ActivityPub Item with
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue