Developers
This chapter documents the stable, public surface of POM Events: the content model, the meta keys, the REST exposure, the shortcodes, the filters and actions, and the conventions integrations should follow.
In this chapter
| Topic | Article |
|---|---|
| Post type, taxonomies and meta | Content model |
| What is exposed over REST | REST API and event meta |
| Adding to the settings screen | Settings extension |
| Adding fields to the event panel | Event metabox extension |
| Adding columns to the attendee table | Attendee table columns |
| Reacting to a registration | Registration lifecycle hooks |
| Reacting to a status change | Attendee status hooks |
| The WooCommerce path | WooCommerce integration hooks |
| The public shortcodes | Shortcodes |
| Customizing the templates | Template integration |
| Querying events correctly | Event query recipes |
| Writing safe integration code | Escaping, sanitization and capabilities |
| What you can rely on | Compatibility contract |
The three assumptions to build on
The theme gates the runtime. POM Events only registers its content type, templates and shortcodes when the active theme's template is pom. Code that assumes the event post type exists must check, because on another theme it does not.
Dates exist twice. The editable datetimes live in the event's meta array; sortable Y-m-d values are derived and stored separately on save. Query on the derived values; read the datetimes for display.
Attendees are a meta array. Registrations are stored on the event as a map keyed by user ID, not in a custom table. That is why registering creates a WordPress user.
Stable identifiers
Safe to depend on:
- the
eventpost type; - the
event_typeandevent_categorytaxonomies, plus sharedpost_tag; - the price of admission for querying:
event_start_dateandevent_end_date; - the
event_assistantsandattending_usersmeta keys; - the documented shortcodes;
- the documented filters and actions.
Not stable
Internal class names, admin markup, AJAX action names, generated asset paths and the internal shape of the settings storage. Build against what is documented here.
A note on the theme dependency
Guard every integration:
add_action( 'init', function () {
if ( ! post_type_exists( 'event' ) ) {
return;
}
// Safe to integrate.
}, 20 );
That single check covers both the theme gate and the load order, and it is the pattern used throughout this chapter.