Repository navigation
Conversation
…#80 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
…nt::occurrences() Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…refs #80 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012qcUmetivvBjHfnsSTNcvW
Preview changes with PlaygroundCustomize PR PlaygroundTo customize the Playground preview for this specific PR, create a file at:
The override is merged into the generated blueprint and can be used to:
Example: {
"$schema": "https://gatherpress.org/playground-preview/pr-override-schema.json",
"landingPage": "/wp-admin/edit.php?post_type=gatherpress_venue",
"siteOptions": {
"show_on_front": "page"
},
"features": {
"networking": true
},
"prependSteps": [
{
"step": "installPlugin",
"pluginData": {
"resource": "wordpress.org/plugins",
"slug": "simple-location"
},
"options": {
"activate": true
}
}
],
"appendSteps": [
{
"step": "runPHP",
"code": ""
}
]
}Go to Playground PR preview customization for more details. You can preview the recent changes for PR#2612 with the following PHP versions: PHP Version 8.4PHP Version 8.2PHP Version 8.1Download Made with 💙 from GatherPress & a little bit of WordPress Playground. Changes will not persist between sessions. |
Refs #80. Stacked on #2602, so review that first. This does not close the issue.
Proposed changes:
A single place for code to ask for an event's dates, where every event is a series of one. Nothing is stored and no existing caller changes yet. Repeat rules, and
gatherpress-recurring-eventstoday, can supply more dates through the filters without callers changing. This follows Dossy's design write-up.Event\Occurrenceis a read-only value: series post ID, key (recurrence_id), start and end in the event's timezone, whether it lasts all day, and its status (an event status slug, withis_canceled()).Event\Occurrences, one instance per event, fromEvent::occurrences(). It works out the event's one date once and keeps it, which is also where repeat rules and their expansion cache will live:in_range( $from, $to )returns the occurrences that overlap a range, in start order. The range end is exclusive.find( $recurrence_id )returns one occurrence by key, ornull.on_day( $day )returns the first occurrence that starts on a date in the event's timezone, ornull.primary()returns the occurrence a series shows by default: the first that hasn't ended, preferring one that isn't canceled, or the last when all have ended. For a series of one, that's its one date.Occurrences::recurrence_id( $start, $all_day )builds the key: the local start asYmd\THis, or the local date asYmdfor all-day. These are the forms events.wordpress.org already uses in URLs.gatherpress_event_occurrences(range),gatherpress_event_occurrence(by key) andgatherpress_event_primary_occurrence.docs/developer/data-model/README.md.Rule storage is left out on purpose until the open questions on #2602 are settled.
Requirements from events.wordpress.org
@bor0 listed what their Groups integration uses from
gatherpress-recurring-events(gpre) (comment), now tracked on #80. Groups will move to core's API sogprecan be removed. Until then,gprecan still supply dates through the filters here.find()on_day()in_range()primary()Occurrence::$status,is_canceled()Testing instructions:
In the terminal:
npm run test:unit:php. All tests pass.20261211T200000 2026-12-11T20:00:00-05:00.🤖 Generated with Claude Code