Disable contact forms on past WordCamp sites - #22
Closed
dd32 wants to merge 4 commits into
Closed
Conversation
Replace Jetpack contact form HTML with a message when: 1. A newer event site exists for the same city, OR 2. The event ended more than 18 months ago. This reduces spam sent to organizers of past events. The replacement message directs visitors to the latest edition (if available) and includes a link to report Code of Conduct concerns to the WordPress Incident Response Team. Uses the jetpack_contact_form_html filter as suggested in the issue discussion. Fixes WordPress#1468 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
dd32
commented
Mar 12, 2026
Comment on lines
+160
to
+163
| // Check if the event is still ongoing. | ||
| if ( $end_date && time() < ( (int) $end_date + DAY_IN_SECONDS ) ) { | ||
| return $html; | ||
| } |
Owner
Author
There was a problem hiding this comment.
Optimization: Assume there isn't a new site for the first 3 months.
Optimization per review feedback: avoid the expensive database query to find a newer site during the first 3 months after an event ends, since a new edition is unlikely to exist that soon. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests the contact form disabling logic for past WordCamp sites: - Past event with newer site disables form with redirect message - Current/future event keeps form active - Recent past event without newer site keeps form active - Old past event (>18 months) disables form - Disabled form includes Code of Conduct reporting link - Event with no end date keeps form active Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Owner
Author
|
Re-filed as WordPress#1656 — WordPress#1656 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
get_latest_home_url()logic), ORjetpack_contact_form_htmlfilter as suggested by @jeherve in the issue discussionlatest-site-hints.phpas suggested by @dd32Implementation details
get_latest_home_url()function andget_wordcamp_post()end date logicTest plan
Fixes WordPress#1468
🤖 Generated with Claude Code