Events calendar REST API
GET /wp-json/ecwp/v1/events
Public, read-only, returns published events only. Each item is one occurrence, so a multi-date event can appear more than once.
| Parameter | Example | Notes |
|---|---|---|
year, month | year=2026&month=11 | Events overlapping that month. Default: current month. |
upcoming, from | upcoming=1&from=2026-11-05 | Events starting on or after that day. |
search | search=yoga | Matching events on any date. |
timezone | timezone=Asia/Kolkata | Visitor’s IANA timezone, used for month and day boundaries. Default: site timezone. |
tax, term | tax=wood-category&term=12 | Filter by event category or tag (term ID). |
per_page | per_page=50 | 1–200, default 100. |
Response item:
{
"id": 123,
"source": "ecwp",
"title": { "rendered": "Summer Fair" },
"link": "https://example.com/events/summer-fair/",
"ecwp": {
"startdate": 1786000000,
"enddate": 1786010800,
"allday": false,
"timezone": "Europe/London",
"color": "#6d28d9",
"excerpt": "Stalls, music and food…",
"img": "https://example.com/wp-content/uploads/fair-150x150.jpg",
"venue": "Town Square"
}
}
startdate and enddate are Unix timestamps. source is tec for events read from The Events Calendar in compatibility mode.
The settings used by the front end are at GET /wp-json/ecwp/v1/settings. Events are also exposed by the core endpoint /wp/v2/wood-event, with the same ecwp field.
Data model
| Item | Name |
|---|---|
| Events post type | wood-event |
| Venues post type | wood-venue |
| Organizers post type | wood-organizers |
| Categories / tags | wood-category / wood-event-tag |
| Event dates (post meta) | _ecwp_start, _ecwp_end (local time, Y-m-d H:i:s), _ecwp_timezone, _ecwp_all_day |
| Occurrences table | {prefix}ecwp_occurrences (UTC; rebuilt from the meta) |
| Venue / organizers on an event | ecwp_venue_id, ecwp_organizer_id (array) |
| Colour, website | ecwp_event_text_bg, ecwp_event_url_website |
The 1.5 keys ecwp_event_date_start and ecwp_event_date_end (Unix timestamps) are still kept in sync, and writing them still works, so older import scripts don’t break. New code should use the event store:
Ecwp_Event_Store::save( $post_id, '2026-12-01 18:00:00', '2026-12-01 20:00:00', 'Europe/London', false );
$dates = Ecwp_Event_Store::get( $post_id ); // start_local, end_local, timezone, all_day, start_ts, end_ts
Template override
Copy public/partials/single-wood-event.php from the plugin to your theme as single-wood-event.php and edit it. The plugin uses your theme’s copy automatically.
Actions and filters
| Hook | Type | Use |
|---|---|---|
modern_single_template_start, modern_single_template_end | action | Wrap the event page. |
modern_single_sidebar | action | Output the event details sidebar. |
modern_organizers | action | Output the organizers list. |
monthly_events_time | filter | Change how a date/time is formatted on the event page. |
monthly_events_venue | filter | Change the venue name shown. |
modern_sidebar_title | filter | Change the sidebar heading. |
ecwp_default_event_color | filter | Colour for events without one (1.6). |
ecwp_archive_calendar | filter | Return false to keep your theme’s archive at /events/ (1.6). |
ecwp_tec_shortcode_alias | filter | Return false to stop handling [tribe_events] (1.6). |
ecwp_tec_event_color | filter | Colour for events shown from The Events Calendar (1.6). |
ecwp_tec_import_past_window, ecwp_tec_import_future_window | filter | Seconds before/after today to import recurring dates (1.6). |
ecwp_tec_import_seo_meta_prefixes | filter | Meta key prefixes copied on import (1.6). |
Example — show the calendar in a theme template:
<?php echo do_shortcode( '[wp_monthly_events view="list"]' ); ?>
Imports and submissions (1.7 and 1.8)
- Calendar import (1.7):
Ecwp_Ical_Importer::sync_source( $id )syncs a saved calendar from code, for example on a schedule;Ecwp_Ical_Importer::sources()lists them. Filtersecwp_ical_parse_argsandecwp_ical_event_postarr; actionsecwp_ical_importedandecwp_ical_synced. - Asset loading (1.7): the calendar’s scripts load only where a calendar or an event is shown. Use the
ecwp_load_assetsfilter to force them on or off for a page, andecwp_load_fontsto turn the bundled fonts off. - Event submissions (1.8):
ecwp_submit_event( $args )creates an event under the rules set in Events Calendar → Submissions, andPOST /ecwp/v1/submissionsdoes the same over REST. Full reference - Structured data (1.8): the
ecwp_event_schemafilter changes the Event data printed on event pages; returnfalseto print none.
Translations
The text domain is monthly-events-calendar. Translate on translate.wordpress.org or with Loco Translate.