From df04913ba13dbd28995b4b7b0ffa53d6de1f0b40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Menrath?= Date: Tue, 10 Sep 2024 18:48:02 +0200 Subject: [PATCH] fix event category mapping when so categories are present --- includes/class-settings.php | 3 +++ templates/settings.php | 2 ++ 2 files changed, 5 insertions(+) diff --git a/includes/class-settings.php b/includes/class-settings.php index bfc1e82..26248af 100644 --- a/includes/class-settings.php +++ b/includes/class-settings.php @@ -73,6 +73,9 @@ class Settings { * @param array $event_category_mappings The settings value. */ public static function sanitize_event_category_mappings( $event_category_mappings ) { + if ( empty( $event_category_mappings ) ) { + return array(); + } foreach ( $event_category_mappings as $taxonomy_slug => $event_category ) { if ( ! self::is_allowed_event_category( $event_category ) ) { unset( $event_category_mappings[ $taxonomy_slug ] ); diff --git a/templates/settings.php b/templates/settings.php index da74646..34b6bb3 100644 --- a/templates/settings.php +++ b/templates/settings.php @@ -93,6 +93,7 @@ $current_category_mapping = \get_option( 'activitypub_event_extensions_ev +

@@ -128,6 +129,7 @@ $current_category_mapping = \get_option( 'activitypub_event_extensions_ev
+