Skip to content

Instantly share code, notes, and snippets.

@woogist
Created April 30, 2015 12:09
Show Gist options
  • Save woogist/5e9a63a52b7a27e5b930 to your computer and use it in GitHub Desktop.
Save woogist/5e9a63a52b7a27e5b930 to your computer and use it in GitHub Desktop.
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