• Resolved alpinaweb

    (@alpinaweb)


    Hello,
    I would like to use hooks to execute some functions on events related to the plugin. Do something on “Appointment Booked Successfuly” for instance.
    Is there a section in the documentation where i can learn the hooks of the plugin? Are there any hooks in the plugin?

    Thanks in advance.
    Best Regards

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

    (@codepeople)

    Hi,

    The hooks are not currently documented, however the hook you are looking for “Appointment Booked Successfuly” is the following:

    add_action( 'cpappb_process_data', 'my_function_appointment_booked', 10, 1 );
    
    function my_function_appointment_booked($params)
    {
        // ... 
    }

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

    Thank you for using the plugin!

    Thread Starter alpinaweb

    (@alpinaweb)

    Hello,

    Nice, can you also provide me with the hook to when a Booking Order gets its Status set as “Approved”?

    Thank you!

    Plugin Author codepeople

    (@codepeople)

    Hi,

    Hook for booking status modifications:

    add_action( 'cpappb_update_status', 'my_function_appointment_status_changed', 10, 2 );
    
    function my_function_appointment_status_changed($itemnumber, $status)
    {
        // ... 
    }

    First parameter the booking ID and second parameter the new status.

    Thank you for using the plugin!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Help with WordPress Hooks’ is closed to new replies.