eo_get_user_booking_history
since 1.2
Pro
eo_get_user_booking_history( $user_id )
Gets bookings a user has made.
Bookings include confirmed and pending bookings.
Example
Display a user's previous bookings
if( get_current_user_id() ){
$bookings = eo_get_user_booking_history( get_current_user_id() );
if( $bookings ){
echo '<ul>';
foreach( $bookings as $booking ){
printf(
'<li> You booked %1$d tickets for %2$s on %3$s </li>',
eo_get_booking_meta( $booking->ID, 'ticket_quantity' ),
get_the_title( eo_get_booking_meta( $booking->ID, 'event_id' ) ),
eo_get_booking_date( $booking->ID, 'jS F Y' ),
);
}
echo '</ul>';
}
}
Parameters
Return value
array
|
Array of bookings the user has made
|
Changelog