• Resolved sessponthu

    (@sessponthu)


    Hi there!

    One of my clients is a doctor, and they have a problem with patients not turning up for their booked slots. They want a system which notifies the user after the first missed appointment and possibly bans him/her at the second or third occasion.

    Now, I am creating a custom plugin for that purpose and I was wondering do you have any hooks that I could use? Or should I filter the data ‘earlier’ with some WordPress filter or something?

    Thanks in advance,
    Regards,
    Zsolt

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author codepeople

    (@codepeople)

    Hi,

    The hooks are not currently documented, however the hook you are looking for intercepting the info before storing the appointment is the following:

    add_action( 'cpappb_process_data_before_insert', 'my_function_appointment_booking', 10, 1 );
    
    function my_function_appointment_booking($params)
    {
        // ... 
    }

    The parameter $params contains an associative array with the selected date-time and form data.

    Thank you for your interest in the plugin!

    • This reply was modified 4 years, 11 months ago by codepeople.
    Thread Starter sessponthu

    (@sessponthu)

    Hi,

    Thanks for the info! I found the hook and I can indeed watch all incoming data which is great.However in my case, I would need a way to not allow the user to book if certain criteria (his email checked against a db) is met.

    Is there a way I can do that via the action? For example I tried it with a die; but its a bit drastic I guess.

    Thanks in advance

    Plugin Author codepeople

    (@codepeople)

    Hi,

    Into that hook redirect to a page with a message indicating that the booking couldn’t be completed and stop the page execution with an “exit();” after the redirection to be sure that it doesn’t stores the booking.

    Hope this helps.

    Thread Starter sessponthu

    (@sessponthu)

    Thanks a lot, works like a charm! ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Way To Block Certain Users’ is closed to new replies.