Skip to content

Commit

Permalink
Fix filter
Browse files Browse the repository at this point in the history
  • Loading branch information
olatechpro committed Jul 24, 2024
1 parent f4c60e4 commit 0aa6f2f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/calendar/calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,11 @@ public function get_filters()
// phpcs:disable WordPress.Security.NonceVerification.Recommended

$current_user = wp_get_current_user();

if (!empty($_REQUEST['reset_user_filter'])) {
$this->update_user_meta($current_user->ID, self::USERMETA_KEY_PREFIX . 'filters', []);
}

$filters = [];
$old_filters = $this->get_user_meta($current_user->ID, self::USERMETA_KEY_PREFIX . 'filters', true);

Expand Down Expand Up @@ -1838,6 +1843,7 @@ class="co-filter <?php echo esc_attr($active_class); ?> <?php echo esc_attr($sel
foreach ($this->content_calendar_filters() as $select_id => $select_name) {
echo '<input type="hidden" name="' . esc_attr($select_name) . '" value="" />';
} ?>
<input type="hidden" name="reset_user_filter" value="1"/>
</form>
<?php
return ob_get_clean();
Expand Down

0 comments on commit 0aa6f2f

Please sign in to comment.