diff --git a/includes/class-wporg-gp-translation-events-translation-listener.php b/includes/class-wporg-gp-translation-events-translation-listener.php index 95a55f14..df962058 100644 --- a/includes/class-wporg-gp-translation-events-translation-listener.php +++ b/includes/class-wporg-gp-translation-events-translation-listener.php @@ -157,10 +157,11 @@ function ( $event ) use ( $at ) { // phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed // phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.Found private function select_events_user_is_registered_for( array $events, int $user_id ): array { + $attending_event_ids = get_user_meta( $user_id, WPORG_GP_Translation_Events_Route::USER_META_KEY_ATTENDING, true ); return array_filter( $events, - function ( $event ) use ( $attending_event_ids ) { - return isset( $attending_event_ids[ $event->ID ] ); + function ( WPORG_GP_Translation_Events_Event $event ) use ( $attending_event_ids ) { + return isset( $attending_event_ids[ $event->id() ] ); } ); }