Hooks Reference
Hooks Reference
Tickets Please exposes action and filter hooks throughout its codebase so you can extend and customize behavior without modifying plugin files. All hooks use the tickets_please_* namespace.
Add hook callbacks in your theme’s functions.php file or in a custom plugin.
Actions
Actions fire at specific points in the plugin’s execution. Use add_action() to attach your callback.
tickets_please_attendee_created
Fires after a new attendee record is created.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$attendee_id | int | The new attendee’s post ID. |
$data | array | Attendee data including ticket_id, event_id, name, email, and status. |
Example:
add_action( 'tickets_please_attendee_created', function ( $attendee_id, $data ) { // Send attendee data to an external CRM. wp_remote_post( 'https://crm.example.com/api/contacts', array( 'body' => wp_json_encode( array( 'name' => $data['name'], 'email' => $data['email'], 'event' => get_the_title( $data['event_id'] ), ) ), ) );}, 10, 2 );tickets_please_attendee_status_changed
Fires when an attendee’s status transitions from one value to another.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$attendee_id | int | The attendee’s post ID. |
$old_status | string | The previous status (e.g., pending, confirmed, cancelled). |
$new_status | string | The new status. |
Example:
add_action( 'tickets_please_attendee_status_changed', function ( $attendee_id, $old_status, $new_status ) { if ( 'cancelled' === $new_status ) { // Log cancellation for reporting. error_log( 'Attendee ' . $attendee_id . ' cancelled (was: ' . $old_status . ')' ); }}, 10, 3 );tickets_please_attendee_status_{$status}
Fires when an attendee transitions to a specific status. Dynamic hook — replace {$status} with the target status name.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$attendee_id | int | The attendee’s post ID. |
Example:
// Fires only when an attendee is confirmed.add_action( 'tickets_please_attendee_status_confirmed', function ( $attendee_id ) { // Send confirmation SMS via Twilio. $email = get_post_meta( $attendee_id, '_attendee_email', true ); my_send_confirmation_sms( $email );} );tickets_please_attendee_checked_in
Fires when an attendee is marked as checked in at the event.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$attendee_id | int | The attendee’s post ID. |
Example:
add_action( 'tickets_please_attendee_checked_in', function ( $attendee_id ) { $event_id = get_post_meta( $attendee_id, '_attendee_event_id', true ); // Update a live attendance counter. $count = (int) get_post_meta( $event_id, '_live_checkin_count', true ); update_post_meta( $event_id, '_live_checkin_count', $count + 1 );} );tickets_please_order_completed
Fires after a ticket order is fully processed and payment is confirmed.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$order_id | int | The order post ID. |
Example:
add_action( 'tickets_please_order_completed', function ( $order_id ) { $buyer_email = get_post_meta( $order_id, '_tec_order_buyer_email', true ); $total = get_post_meta( $order_id, '_tec_order_total', true ); // Track revenue in analytics. my_analytics_track( 'purchase', array( 'email' => $buyer_email, 'total' => $total, ) );} );tickets_please_refund_processed
Fires after a refund is processed for an order.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$order_id | int | The order post ID. |
$amount | float | The refunded amount. |
Example:
add_action( 'tickets_please_refund_processed', function ( $order_id, $amount ) { // Notify accounting system. wp_remote_post( 'https://accounting.example.com/api/refunds', array( 'body' => wp_json_encode( array( 'order_id' => $order_id, 'amount' => $amount, ) ), ) );}, 10, 2 );tickets_please_event_cancelled
Fires when an event’s status is changed to cancelled.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$event_id | int | The event post ID. |
Example:
add_action( 'tickets_please_event_cancelled', function ( $event_id ) { // Notify all attendees of cancellation. $attendees = get_posts( array( 'post_type' => 'tec_tc_attendee', 'meta_key' => '_attendee_event_id', 'meta_value' => $event_id, 'numberposts' => -1, ) ); foreach ( $attendees as $attendee ) { $email = get_post_meta( $attendee->ID, '_attendee_email', true ); wp_mail( $email, 'Event Cancelled', 'The event has been cancelled.' ); }} );tickets_please_deactivate
Fires during plugin deactivation, before capabilities are removed and cleanup runs.
Parameters: None.
Example:
add_action( 'tickets_please_deactivate', function () { // Clean up custom options or scheduled events. delete_option( 'my_custom_tp_extension_settings' ); wp_clear_scheduled_hook( 'my_custom_tp_cron' );} );Filters
Filters modify data as it passes through the plugin. Use add_filter() to attach your callback. Always return a value.
tickets_please_event_rewrite_slug
Filters the URL slug used for event permalinks.
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
$slug | string | 'event' | The event URL slug. |
Returns: string — The modified slug.
Example:
add_filter( 'tickets_please_event_rewrite_slug', function ( $slug ) { return 'happening'; // URLs: example.com/happening/event-name/} );After changing, visit Settings > Permalinks to flush rewrite rules.
tickets_please_frontend_event_details
Filters the HTML output of the front-end event details section.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$html | string | The rendered event details HTML. |
Returns: string — The modified HTML.
Example:
add_filter( 'tickets_please_frontend_event_details', function ( $html ) { // Add a custom notice above event details. return '<div class="custom-notice">All times shown in Eastern Time.</div>' . $html;} );tickets_please_show_related_events
Filters whether related events are displayed on single event pages.
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
$show | bool | true | Whether to show related events. |
Returns: bool
Example:
add_filter( 'tickets_please_show_related_events', function ( $show ) { // Hide related events on past events. if ( get_post_meta( get_the_ID(), '_tribe_event_end_date', true ) < current_time( 'mysql' ) ) { return false; } return $show;} );tickets_please_related_events_count
Filters the number of related events displayed.
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
$count | int | 3 | Number of related events to display. |
Returns: int
Example:
add_filter( 'tickets_please_related_events_count', function ( $count ) { return 6; // Show 6 related events.} );tickets_please_template_path
Filters the path to the plugin’s template directory.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$path | string | The default template directory path within the plugin. |
Returns: string — The modified path.
Example:
add_filter( 'tickets_please_template_path', function ( $path ) { return get_stylesheet_directory() . '/custom-event-templates/';} );tickets_please_json_ld_data
Filters the JSON-LD structured data array before output.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$data | array | The Event schema array. |
$event_id | int | The event post ID. |
Returns: array — The modified schema array. Return an empty array to suppress output.
Example:
add_filter( 'tickets_please_json_ld_data', function ( $data, $event_id ) { // Add a performer to the schema. $data['performer'] = array( '@type' => 'Person', 'name' => get_post_meta( $event_id, '_event_speaker', true ), ); return $data;}, 10, 2 );tickets_please_gf_form_data
Filters Gravity Forms entry data before it is saved to the attendee record.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$data | array | The form entry data. |
Returns: array — The modified entry data.
Example:
add_filter( 'tickets_please_gf_form_data', function ( $data ) { // Normalize phone number format. if ( isset( $data['phone'] ) ) { $data['phone'] = preg_replace( '/[^0-9+]/', '', $data['phone'] ); } return $data;} );tickets_please_cart_hold_time
Filters the cart hold duration in seconds.
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
$seconds | int | 1800 | Cart hold time (30 minutes). |
Returns: int — The modified hold time in seconds.
Example:
add_filter( 'tickets_please_cart_hold_time', function ( $seconds ) { return 900; // 15-minute cart hold for high-demand events.} );tickets_please_email_headers
Filters email headers for Tickets Please notification emails.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$headers | array | Email headers array. |
$email_type | string | The email type identifier (e.g., confirmation, low_stock_alert, sold_out_alert). |
Returns: array — The modified headers array.
Example:
add_filter( 'tickets_please_email_headers', function ( $headers, $email_type ) { // BCC all ticket emails to a backup address. if ( 'confirmation' === $email_type ) { $headers[] = 'Bcc: records@example.com'; } return $headers;}, 10, 2 );Common Questions
Can I use anonymous functions (closures) with hooks?
Yes, but you cannot remove an anonymous function with remove_action() or remove_filter() later. If you need removability, use a named function or a class method.
What priority should I use?
The default priority is 10. Use lower numbers (e.g., 5) to run before other callbacks, higher numbers (e.g., 20) to run after. Most customizations work fine at the default.
Do hooks fire during REST API requests?
Yes. Actions like tickets_please_attendee_created fire regardless of whether the attendee was created via the admin, front-end form, or REST API.
Are there hooks for the admin list tables?
Tickets Please uses standard WordPress list table hooks. Use manage_tribe_events_posts_columns and manage_tribe_events_posts_custom_column to add custom columns to the events list table.
Where should I put my hook callbacks?
For theme-specific customizations, use your theme’s functions.php. For site-wide customizations that should survive theme changes, create a small custom plugin in wp-content/plugins/.
Next Steps
- Meta Keys Reference — Understand the data structures these hooks interact with.
- REST API Reference — See how API endpoints relate to hook-triggering operations.
- SEO & Structured Data — Detailed usage of the
tickets_please_json_ld_datafilter.