Skip to content

Commit

Permalink
Helpers: Restore switched blog when returning early
Browse files Browse the repository at this point in the history
Otherwise it stays switched, and that leads to subtle bugs elsewhere in the codebase.

Fixes the bug introduced in f0e80a5.
  • Loading branch information
iandunn committed Jan 20, 2024
1 parent 160ca9e commit 4a7b077
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions public_html/wp-content/mu-plugins/4-helpers-wcpt.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ function get_wordcamp_offset( WP_Post $wordcamp ): int {
switch_to_blog( WORDCAMP_ROOT_BLOG_ID );

if ( ! $wordcamp->{'Event Timezone'} || ! $wordcamp->{'Start Date (YYYY-mm-dd)'} ) {
restore_current_blog();
return 0;
}

Expand Down

0 comments on commit 4a7b077

Please sign in to comment.