Skip to main content
NetterTech
Event management for WordPress, done right.

Hooks Reference

For developers extending NetterTech Events with custom actions and filters.

All hooks use the nte_ prefix and follow WordPress naming conventions. The plugin ships 123 hook constants. This page covers the ones you’re most likely to use; the full reference is in docs/HOOKS.md in the plugin source.


Key action hooks

Plugin lifecycle

nte_init - Fires after the plugin is fully initialized. The safe point to register integrations with plugin services.

add_action( 'nte_init', function( $plugin ) {
    // Plugin is ready - register your integration here
} );

nte_activated / nte_deactivated - Fire on plugin activation and deactivation. Use for one-time setup or cleanup tasks - creating options, clearing scheduled hooks.


Event operations

nte_after_save_event - Fires after an event is saved. This is where to sync to external calendars, trigger notifications, or update related data.

add_action( 'nte_after_save_event', function( $event ) {
    // $event is the saved Event object
    wp_mail( 'team@venue.com', 'Event updated', $event->get_title() );
} );

Note: the plugin’s own ShadowPostSyncService listens to this hook to keep WordPress search and the Gutenberg link dialog in sync with your event data.

nte_before_delete_event / nte_after_delete_event - Fire before and after deletion. The before hook receives the Event object; the after hook receives the ID and a snapshot of the deleted event. Useful for archiving to external systems before the record is gone.

nte_occurrences_generated - Fires after the plugin pre-computes occurrences for a recurring event. Receives the Event, the array of Occurrence objects, and the RecurrenceRule.

add_action( 'nte_occurrences_generated', function( $event, $occurrences, $rule ) {
    // $occurrences is an array of Occurrence objects
    error_log( count( $occurrences ) . ' occurrences generated for: ' . $event->get_title() );
}, 10, 3 );

nte_occurrence_status_changed - Fires when an occurrence is cancelled, postponed, or otherwise changes status. Receives the occurrence ID, new status, and old status.

add_action( 'nte_occurrence_status_changed', function( $id, $status, $old_status ) {
    if ( 'cancelled' === $status ) {
        notify_attendees_of_cancellation( $id );
    }
}, 10, 3 );

Attendees and orders

nte_rsvp_submitted - Fires after a successful RSVP. Receives the created Attendee object.

add_action( 'nte_rsvp_submitted', function( $attendee ) {
    // Common use: add to mailing list
    mailchimp_subscribe( $attendee->get_email(), $attendee->get_name() );
} );

nte_capacity_reserved / nte_capacity_released - Fire when ticket capacity is reserved (item added to cart) and released (cart expired or order cancelled). Both receive the ticket type ID and quantity.

nte_capacity_oversell_detected - Fires during order processing when an oversell condition is detected. Receives the WC_Order and an array describing the issue. Use this to alert staff rather than silently failing.


Activity logging

nte_activity_logged - Fires whenever any administrative action is logged. Receives action type, object type, object ID, title, and details array. Useful for forwarding to external audit systems.


Template loading

nte_before_template_load / nte_after_template_load - Fire immediately before and after a template file is included. Receive the file path and the template arguments array.

The dynamic nte_get_template_part_{$slug} action fires before each template part is loaded, with the slug baked into the hook name - e.g., nte_get_template_part_parts/event-card.


Key filter hooks

Template filters

nte_template_args - Filter variables passed to any template before it loads. The most practical way to inject custom data without overriding an entire template file. See the Templates guide for examples.

nte_template_paths - Filter the directory search order. Paths are keyed by priority (lower number = checked first). Default priorities: 1 = child theme, 10 = parent theme, 100 = plugin.

add_filter( 'nte_template_paths', function( $paths ) {
    // Add a custom directory with higher priority than the theme
    $paths[5] = WP_CONTENT_DIR . '/my-event-templates/';
    return $paths;
} );

nte_get_template_part - Filter candidate filenames before the template resolver picks one. Useful for conditional template switching based on category, user role, or request context.

nte_container_class - Filter CSS classes on template containers. Receives the class array, the context string, and the variant.


Configuration filters

nte_activity_log_retention_days - Filter how long activity log entries are kept. Default is 90 days.

add_filter( 'nte_activity_log_retention_days', function( $days ) {
    return 365; // Extend to one year
} );

nte_rate_limit_bypass - Filter whether the current user bypasses REST API rate limiting. Admins bypass by default; use this to extend the bypass to other roles.

nte_csp_directives - Filter the Content Security Policy headers the plugin emits. Necessary if your theme or integrations load scripts from additional domains.


Email filters

nte_reminder_email_data - Filter the data array passed to the reminder email template before rendering. Add custom variables that your overridden email template can use.

nte_reminder_email_content - Filter the final rendered HTML of reminder emails after template rendering. Useful for appending footers or making content changes without overriding the template file.


Ticket filters

nte_ticket_form_html - Filter the ticket purchase form HTML. Return a non-empty string to replace the default form entirely. This is the hook Pro uses to inject its multi-ticket batch checkout form.

nte_ticket_type_limit - Filter the maximum number of ticket types allowed per event. The free tier defaults to 1; return null to remove the restriction.


Cross-referencing templates and hooks

Most meaningful customizations combine both approaches. A template override controls the markup; hooks control the data and behavior. The Templates guide covers the override mechanism in detail, including the nte_template_args filter for injecting data without full template copies.


See also: REST API | Templates | Getting started