Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barryhughes/f7a7b98c374e1c2ba5bb12c922d91264 to your computer and use it in GitHub Desktop.
Save barryhughes/f7a7b98c374e1c2ba5bb12c922d91264 to your computer and use it in GitHub Desktop.
<?php
### Example of adding an extra column to the Event Tickets/Event Tickets Plus
### attendee table.
###
### Tested with Event Tickets Plus 4.6.2
# Register our extra column
add_filter( 'tribe_tickets_attendee_table_columns', function( $columns ) {
$columns['extra'] = 'My extra column';
return $columns;
} );
# Populate the extra column ($item can be used to identify the actual attendee object)
add_filter( 'tribe_events_tickets_attendees_table_column', function( $val, $item, $column ) {
static $count = 0;
if ( 'extra' === $column ) {
$val = 'Extra column value ' . ++$count;
}
return $val;
}, 10, 3 );
@acleyfilho
Copy link

Thank's a lot!!!! Super helpfull 👏👏👏

@barryhughes
Copy link
Author

Thanks for the note (happy to hear this still works some 4 years later)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment