Skip to content

Skip cancelled events in city redirect and latest site hints#40

Open
dd32 wants to merge 3 commits intoproductionfrom
fix/claude/1600-skip-cancelled-redirect-v2
Open

Skip cancelled events in city redirect and latest site hints#40
dd32 wants to merge 3 commits intoproductionfrom
fix/claude/1600-skip-cancelled-redirect-v2

Conversation

@dd32
Copy link
Owner

@dd32 dd32 commented Mar 12, 2026

Summary

  • Cancelled WordCamp events are no longer used as redirect targets for city.wordcamp.org URLs
  • Cancelled events are also excluded from the "next edition" banner in latest-site-hints
  • Example: granada.wordcamp.org will now redirect to the 2024 (completed) event instead of the cancelled 2025 one

Changes

Two files updated with the same approach:

  1. sunrise-wordcamp.php - get_latest_site(): JOIN with the central blog posts/postmeta tables to check WordCamp post status, excluding wcpt-cancelled
  2. latest-site-hints.php - get_latest_home_url(): Same JOIN pattern applied to all three query variants (year.city, city/year, and events.wordpress.org paths)

Both use LEFT JOINs with a NULL check, so sites without a linked WordCamp post are still included.

Test plan

  • All existing tests pass (305 tests, 570 assertions)
  • Cancel a WordCamp and verify city.wordcamp.org redirects to the previous (non-cancelled) edition
  • Verify the "next edition" banner on past sites does not link to cancelled events
  • Verify normal (non-cancelled) redirects still work correctly

Fixes WordPress#1600

🤖 Generated with Claude Code

dd32 and others added 3 commits March 12, 2026 20:44
Cancelled WordCamp events should not be the redirect target for
city.wordcamp.org URLs, nor should they appear as the 'next edition'
in the latest site hints banner.

Join the blogs table with the central blog posts/postmeta tables to
check the WordCamp post status, filtering out wcpt-cancelled events.
Sites without a linked WordCamp post are still included (NULL check).

Fixes WordPress#1600

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The cancelled event filter variables and table prefix are safe SQL
fragments built from internal logic, not user input.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add cancelled sites (2020.seattle and vancouver/2021) to the shared
test database with WordCamp posts set to wcpt-cancelled status.
Verify that get_latest_home_url and get_latest_site skip cancelled
events and return the previous non-cancelled year instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant