Compare commits

...

1 commit

Author SHA1 Message Date
4721ab58f8 refactoring setup class 2024-09-10 18:39:26 +02:00

View file

@ -228,6 +228,24 @@ class Setup {
return $transformer; return $transformer;
} }
/**
* Activates ActivityPub support for all active event plugins event post-types.
*
* @since 1.0.0
*
* @return void
*/
public function activate_activitypub_support_for_active_event_plugins(): void {
// If someone installs this plugin, we simply enable ActivityPub support for all currently active event post types.
$activitypub_supported_post_types = get_option( 'activitypub_support_post_types', array() );
foreach ( $this->active_event_plugins as $event_plugin ) {
if ( ! in_array( $event_plugin['post_type'], $activitypub_supported_post_types, true ) ) {
$activitypub_supported_post_types[] = $event_plugin['post_type'];
}
}
update_option( 'activitypub_support_post_types', $activitypub_supported_post_types );
}
/** /**
* Activates the ActivityPub Event Extensions plugin. * Activates the ActivityPub Event Extensions plugin.
* *
@ -258,13 +276,7 @@ class Setup {
array( 'back_link' => true ), array( 'back_link' => true ),
); );
} }
// If someone installs this plugin, we simply enable ActivityPub support for all currently active event post types.
$activitypub_supported_post_types = get_option( 'activitypub_support_post_types', array() ); self::activate_activitypub_support_for_active_event_plugins();
foreach ( $this->active_event_plugins as $event_plugin ) {
if ( ! in_array( $event_plugin['post_type'], $activitypub_supported_post_types, true ) ) {
$activitypub_supported_post_types[] = $event_plugin['post_type'];
}
}
update_option( 'activitypub_support_post_types', $activitypub_supported_post_types );
} }
} }