Skip to content

Commit

Permalink
Merge pull request #86 from WordPress/fix-stat
Browse files Browse the repository at this point in the history
Fix PHP Notice:  Undefined variable: attending_event_ids
  • Loading branch information
psrpinto authored Feb 16, 2024
2 parents 85c0489 + 1f93e6c commit 1b22ee9
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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() ] );
}
);
}
Expand Down

0 comments on commit 1b22ee9

Please sign in to comment.