eventsmanager icon

Waitlists: prevent overriding personal details

eventsmanager | PRO | 05/06/24 01:32:49 PM UTC | 0 ⭐ | 411 👁️ | Never ⏰ | []
text |

460 B

|

None

|

0 👍

/

0 👎

function waitlists_em_booking_save( $result, $EM_Booking ){
   global $wpdb;
 	if ( $EM_Booking->booking_meta['waitlist'] && ($EM_Booking->booking_status == 6 || $EM_Booking->booking_status == 7) ){
		$data  = array( 'person_id' => 0 );
		$where = array( 'booking_id' => $EM_Booking->booking_id );
		$result= $wpdb->update( EM_BOOKINGS_TABLE, $data, $where);
	}
    return $result;
}
add_filter('em_booking_save', 'waitlists_em_booking_save', 100, 2);

Comments