Skip to content

Instantly share code, notes, and snippets.

@theeventscalendar
Last active August 29, 2015 14:24
Show Gist options
  • Select an option

  • Save theeventscalendar/6e161068d7a91d216b68 to your computer and use it in GitHub Desktop.

Select an option

Save theeventscalendar/6e161068d7a91d216b68 to your computer and use it in GitHub Desktop.
Show the purchaser's phone number in the Tickets attendee list.
if ( function_exists( 'tribe_is_event') ) {
/**
* Adds the phone number to the "Purchaser Email" column.
* @link http://theeventscalendar.com/support/forums/topic/add-attendee-telephone-number-to-attendee-list/
*/
function tribe_953653_add_phone_to_attendee_list( $value, $item, $column ) {
// Change this column name to move the phone number to a different column.
if ( 'purchaser_email' != $column ) {
return $value;
}
$phone_number = get_post_meta( $item['order_id'], '_billing_phone', true );
// Remove the <small></small> tags from this to have the phone number text display at full size.
if ( ! empty( $phone_number ) ) {
return $value . sprintf( '<br><small><b>Phone:</b> %s</small>', sanitize_text_field( $phone_number ) );
}
return $value;
}
add_filter( 'tribe_events_tickets_attendees_table_column', 'tribe_953653_add_phone_to_attendee_list', 10, 3 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment