Example 1 — Clear after a direct update
Refresh the calendar after you changed posts in the database.
<?php
// ... bulk update posts with $wpdb ...
delete_get_calendar_cache();
echo 'Calendar cache cleared'; How It Works
- A direct database change does not fire
save_post. - We clear the cache ourselves.
- The next
get_calendar()shows the new post dates.

