updated plugin Event Bridge for ActivityPub version 1.3.0
This commit is contained in:
@ -13,10 +13,12 @@
|
||||
namespace Event_Bridge_For_ActivityPub\Integrations;
|
||||
|
||||
// Exit if accessed directly.
|
||||
defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore
|
||||
\defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore
|
||||
|
||||
use Event_Bridge_For_ActivityPub\ActivityPub\Transformer\Event\EventOn as EventOn_Event_Transformer;
|
||||
use Event_Bridge_For_ActivityPub\ActivityPub\Transformer\Place\EventOn as EventOn_Location_Transformer;
|
||||
use WP_Post;
|
||||
use WP_Term;
|
||||
|
||||
/**
|
||||
* EventON – Events Calendar
|
||||
@ -66,10 +68,10 @@ final class EventOn extends Event_Plugin_Integration {
|
||||
/**
|
||||
* Returns the ActivityPub transformer for a VS_Event_List event post.
|
||||
*
|
||||
* @param \WP_Post $post The WordPress post object of the Event.
|
||||
* @param WP_Post $post The WordPress post object of the Event.
|
||||
* @return EventOn_Event_Transformer
|
||||
*/
|
||||
public static function get_activitypub_event_transformer( $post ): EventOn_Event_Transformer {
|
||||
public static function get_activitypub_event_transformer( WP_Post $post ): EventOn_Event_Transformer {
|
||||
return new EventOn_Event_Transformer( $post, self::get_event_category_taxonomy() );
|
||||
}
|
||||
|
||||
@ -85,10 +87,10 @@ final class EventOn extends Event_Plugin_Integration {
|
||||
/**
|
||||
* Returns the ActivityPub transformer for a Event_Organiser event venue which is stored in a taxonomy.
|
||||
*
|
||||
* @param \WP_Term $term The WordPress Term/Taxonomy of the venue.
|
||||
* @param WP_Post|WP_Term $term The WordPress Term/Taxonomy of the venue.
|
||||
* @return EventOn_Location_Transformer
|
||||
*/
|
||||
public static function get_activitypub_place_transformer( $term ): EventOn_Location_Transformer {
|
||||
return new EventOn_Location_Transformer( $term );
|
||||
public static function get_activitypub_place_transformer( WP_Post|WP_Term $term ): ?EventOn_Location_Transformer {
|
||||
return $term instanceof WP_Term ? new EventOn_Location_Transformer( $term ) : null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user