Developer Documentation
Monthly Events Calendar is built for developers: an events calendar REST API, standard WordPress post types, a template you can override from your theme, and hooks for each part of the event page. A version in brackets, such as (1.8), shows when something was added.
Change the event page
Copy one template to your theme, or use the event page hooks.
Create events from code
Save dates with the event store, or send events through the submission rules.
Hook into the calendar
PHP filters for loading, colours and the popup, and JavaScript events.
REST API
GET /wp-json/ecwp/v1/events
Public, read-only, returns published events only. Each item is one occurrence, so an event on several dates appears once per date.
| 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, or several IDs separated by commas). |
per_page | per_page=50 | 1–200, default 100. |
Response
{
"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.
Other endpoints
| Endpoint | What it is |
|---|---|
GET /wp-json/ecwp/v1/settings | The display settings the calendar uses. Public. |
POST /wp-json/ecwp/v1/submissions | Create an event under the submission rules (1.8). Reference |
GET /wp-json/ecwp/v1/submissions/form | The submission form’s markup, loaded by the Add event popup (1.8.1). |
GET /wp-json/wp/v2/wood-event | WordPress’s own endpoint for events, 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 |
| Shortcodes | [wp_monthly_events], [wp_monthly_events_submit] |
| Blocks | ecwp/calendar, ecwp/submit-event |
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.
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.
To show the calendar from a theme template:
<?php echo do_shortcode( '[wp_monthly_events view="list"]' ); ?>
PHP actions and filters
Event page
| 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_event_schema | filter | Change the Event structured data on event pages; return false to print none (1.8). |
Calendar and loading
| Hook | Type | Use |
|---|---|---|
ecwp_load_assets | filter | Force the calendar’s scripts on or off for a page (1.7). They load only where a calendar or an event is shown. |
ecwp_load_fonts | filter | Return false to turn off the bundled fonts (1.7). |
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). |
The Events Calendar compatibility
| Hook | Type | Use |
|---|---|---|
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). |
Create events from code
Save an event’s dates with the event store. It writes the meta and rebuilds the occurrences:
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
- From a form:
ecwp_submit_event( $args )creates an event under the rules set in Events Calendar → Submissions (who may submit, approval, emails), andPOST /ecwp/v1/submissionsdoes the same over REST (1.8). Full reference - Calendar import:
Ecwp_Ical_Importer::sync_source( $id )syncs a saved calendar, for example on a schedule;Ecwp_Ical_Importer::sources()lists them. Filtersecwp_ical_parse_argsandecwp_ical_event_postarr; actionsecwp_ical_importedandecwp_ical_synced(1.7).
Add event popup (1.8.1)
The Add event button opens the submission form in a popup on the calendar. The form is fetched from GET /ecwp/v1/submissions/form when the button is first pressed.
| Hook | Type | What it does |
|---|---|---|
ecwp_submit_popup_show | filter | Whether the current visitor gets the button. By default: the button is turned on and this person may submit events. |
ecwp_submit_popup_position | filter | Where the popup opens: right, left or center. |
ecwp_submit_popup_form | filter | The popup form’s options, the same as the shortcode’s: hide, category, button. |
A shorter form in the popup:
add_filter( 'ecwp_submit_popup_form', function ( $atts ) {
$atts['hide'] = 'timezone,website';
return $atts;
} );
Show the button to logged-out visitors too, when only members may submit. The popup then asks them to log in and brings them back to the calendar:
add_filter( 'ecwp_submit_popup_show', function ( $show ) {
return $show || ! is_user_logged_in();
} );
JavaScript
Two events are sent on document:
ecwp:add-eventopens the popup. Dispatch it from your own button:document.dispatchEvent( new CustomEvent( 'ecwp:add-event' ) );. It works on pages where the calendar shows the Add event button.ecwp:event-submittedfires after an event is sent from any submission form.event.detailhas the event’sid, itsstatus(pendingorpublish) and, for published events, itslink.
From 1.8.2 the calendar’s button texts can be changed with WordPress’s hooks script: mCalendar-text-latestEvent (Upcoming Events), mCalendar-text-searchEvent (Search Events) and mCalendar-text-addEvent (Add event). Load your script after wp-hooks:
wp.hooks.addFilter( 'mCalendar-text-addEvent', 'my-theme', function () {
return 'Suggest an event';
} );
Translations
The text domain is monthly-events-calendar. Translate on translate.wordpress.org or with Loco Translate.
