From db4c72db868a80f9c815c9186d55ad3fe1dec2f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Menrath?= Date: Sun, 15 Dec 2024 16:22:16 +0100 Subject: [PATCH] fix GatherPress transmogrifier --- includes/activitypub/transmogrifier/class-gatherpress.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/activitypub/transmogrifier/class-gatherpress.php b/includes/activitypub/transmogrifier/class-gatherpress.php index c7af620..652e041 100644 --- a/includes/activitypub/transmogrifier/class-gatherpress.php +++ b/includes/activitypub/transmogrifier/class-gatherpress.php @@ -442,11 +442,15 @@ class GatherPress { ); if ( $post_id ) { + // Update existing GatherPress event post. $args['ID'] = $post_id; + wp_update_post( $args ); + } else { + // Insert new GatherPress event post. + $post_id = wp_insert_post( $args ); } - // Insert new GatherPress Event post. - $post_id = wp_update_post( $args ); + if ( ! $post_id || is_wp_error( $post_id ) ) { return;