diff --git a/includes/class-setup.php b/includes/class-setup.php index d62b396..47552b8 100644 --- a/includes/class-setup.php +++ b/includes/class-setup.php @@ -228,6 +228,24 @@ class Setup { 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. * @@ -258,13 +276,7 @@ class Setup { 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() ); - 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 ); + + self::activate_activitypub_support_for_active_event_plugins(); } }