Event syncing
Events are pulled from iModules every 15 minutes using a cron process which checks for newly updated events. It works by pulling a list of events that have been updated or created since the time of last sync, and importing them one by one, either creating a new event or modifying an existing one.
That means that any event updated in the WordPress admin will be overwritten if the event is also updated in iModules. The exception to this is an event's featured image, which can be safely updated in WordPress and will never be replaced.
The main functionality for this sync and import process are located in the custom plugin "Cornell Events"
Venues and Timezones
Venues are also imported from iModules if one needs to be created. Each time a new venue is created, it's timezone will also be set based on geographic location so that timezones for events are properly updated.
Event Archives and Listings
The Events Calendar and Events Calendar Pro plugin are used to actually display a list of events on the front-end, and organize the data.
Any functionality available from this plugin can also be used on the site. To see a list of settings for the plugin, go to "Events -> Settings" in the WordPress admin.
The main archive template file is located in the theme folder, cornell/archive-events.php
. All individual template partials can be found in the tribe-events
folder in the theme.
WP CLI Commands
There are also a few helpful WP CLI commands which can be used to manually run a sync or disable cron. They can be run using terminus, once logged in.
To manually sync an individual event based on its iModules ID bash terminus wp cornell-alumni.live -- cornell events sync --id=<IMODULES_ID>
To manually sync all events updated from the time of last sync: bash terminus wp cornell-alumni.live -- cornell events sync --all
There is also a --force
parameter which will ignore the time of last sync and sync all events.
To temporarily disable cron, so that events are not automatically imported every 15 minutes: bash terminus wp cornell-alumni.live -- cornell events cron --off
To reenable cron: bash terminus wp cornell-alumni.live -- cornell events cron --on