Attendee status hooks

The point to hook when an organizer moves a registration between Confirmed, Waiting list and Cancelled.

The action

add_action( 'pom_events_after_assistants_info_update', function ( $event_id, $user_id ) {
    // Runs after the new status has been saved.
}, 10, 2 );

It fires after the registration's status has been written, and before the updated row is returned to the screen.

Reading the new status

The action passes identifiers, not the status. Read it from the event:

add_action( 'pom_events_after_assistants_info_update', function ( $event_id, $user_id ) {
    $assistants = get_post_meta( $event_id, 'event_assistants', true );
    $status     = $assistants[ $user_id ]['status'] ?? '';

    // '' = confirmed, 'waiting-list', 'cancelled'
}, 10, 2 );

An empty status means confirmed. That is the value to test for when detecting a promotion.

The most valuable use: promotion notices

Promoting someone from the waiting list notifies nobody, and that is the single biggest manual burden in running a full event. Automating it is straightforward:

add_action( 'pom_events_after_assistants_info_update', function ( $event_id, $user_id ) {
    $assistants = get_post_meta( $event_id, 'event_assistants', true );

    if ( ! isset( $assistants[ $user_id ] ) || '' !== $assistants[ $user_id ]['status'] ) {
        return; // Not a promotion to confirmed.
    }

    $user  = get_userdata( $user_id );
    $event = get_post( $event_id );

    if ( ! $user || ! $event ) {
        return;
    }

    wp_mail(
        $user->user_email,
        sprintf( __( 'A place is available at %s', 'my-plugin' ), $event->post_title ),
        my_plugin_promotion_body( $event )
    );
}, 10, 2 );

Two cautions before deploying it:

  • You cannot tell what the previous status was from this action alone. Moving a cancelled registration back to confirmed also produces an empty status, so it will also send. If that matters, record the previous status yourself before the change.
  • Organizers may expect to write personally. Automating the message changes their workflow; agree it first.

Other uses

  • Log status changes, which the plugin does not do. Useful when several people manage the same event.
  • Keep an external list in step — a CRM, a check-in system.
  • Notify the organizer when someone is cancelled.
  • Recalculate your own counts, if you display availability elsewhere.

Deletion is separate

Permanently deleting a cancelled registration does not fire this action. If your integration mirrors the attendee list somewhere else, reconcile periodically rather than relying on an event for every removal.

Capacity is not enforced

Manual promotion does not check the event's capacity. If your integration cares, compare the confirmed count with available_space yourself:

$meta     = get_post_meta( $event_id, 'pom', true );
$capacity = (int) ( $meta['available_space'] ?? 0 );

A capacity of zero means unlimited.

Verify

  1. Move a registration between each pair of statuses.
  2. Confirm your handler runs each time and reads the right status.
  3. Confirm a promotion is distinguished from a cancellation.
  4. Confirm a permanent deletion does not fire it, so your reconciliation covers that case.