Last active
August 29, 2015 14:24
-
-
Save theeventscalendar/6e161068d7a91d216b68 to your computer and use it in GitHub Desktop.
Show the purchaser's phone number in the Tickets attendee list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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