Architecture & Delivery
- The plugin registers a custom post type named “Events” (events).
- This allows users to create, edit, and manage events like regular WordPress posts.
- Supports metadata fields for event start and end dates.
- When an event is created or updated, the event start date (_event_start_date) and event end date (_event_end_date) are stored as post meta fields.
- These dates determine when an event is considered expired.
- A scheduled cron job (wpcoredo_schedule_event_cleanup()) is registered to run daily.
- This cron job triggers the function wpcoredo_delete_outdated_events(), which:
- Fetches all events where the end date is in the past.
- Deletes these outdated events.
- If the cron job is not already scheduled, it is set up upon plugin activation.
Built with architecture discipline, user-focused workflows and long-term maintainability in mind.