Created
April 30, 2015 12:09
-
-
Save woogist/5e9a63a52b7a27e5b930 to your computer and use it in GitHub Desktop.
This file contains 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
add_action( 'manage_wc_booking_posts_custom_column', 'wc_custom_bookings_columns', 3 ); | |
function wc_custom_bookings_columns( $column ) { | |
global $post, $booking; | |
if ( empty( $booking ) || $booking->id != $post->ID ) { | |
$booking = get_wc_booking( $post->ID ); | |
} | |
switch ( $column ) { | |
case 'customer': | |
$customer = $booking->get_customer(); | |
$user = get_user_by( 'id', $customer->user_id ); | |
if ( $user ) { | |
echo ' (' . $user->data->user_login . ')'; | |
} | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment