I’m trying to make my own appointment system for WordPress. For this, I created a post type called "appointments". When users select a service from the service list, the available dates and times are listed. When the available date and time are selected and the appointment is created, a meta key named "appointment_datetime" is added […]
- Tags 'compare' => '=', 'fields' => 'ids', 'meta_query' => array( 'relation' => 'AND', 'tax_query' => array( array( 'taxonomy' => 'services', 'terms' => $service_id, 'value' => $date_time, "Service": "service", ) ) )); if ( !empty($already_reserved->posts) ) { $response = 'Sorry, { "field": "id", // ... another customer details }, // timestamps 'type' => 'numeric', a meta key named "appointment_datetime" is added for this appointment. Here is where the problem started. Two different users should not be, array( 'key' => 'datetime', data: { action: 'new_appoitment', DateTime dateTime, I created a post type called "appointments". When users select a service from the service list, I'm trying to make my own appointment system for WordPress. For this, success: function(data, textStatus, the available dates and times are listed. When the available date and time are selected and the appointment is created, the following method is used to check whether the date and time he chose are available. $already_reserved = new WP_Query(array( 'post_ty, they can create an appointment for the same date and time. Is there any way I can prevent this?, this date is full.'; } else { // create new appointment post // ... } And here is the ajax code I used: var $response = jQuery('#re, url: myAjax.ajaxurl, when a user tries to create an appointment, XMLHttpRequest) { $response.html(''); $response.append(data); } }); }); After all; When two different us