# miniCal Actions

miniCal provides us different hooks. They provide a way for running a function at a specific point in the execution of miniCal Core. Callback functions for an Action do not return anything back to the calling Action hook.

```php
do_action( ‘example_action_to_run’, $arg);
```

```php
// The action callback function.
add_action( ‘example_action_to_run’, ‘example_callback_fun’, 10, 1);

function example_callback_fun( $arg) {
You can access the $arg1 here. You just need to manipulate it and check the output.
}
```

This list contains all the actions trigger points of miniCal. You can add a listener with the corresponding action

**Booking Actions List**

| METHOD     | NAME                | PARAMETERS | USE CASE                          |
| ---------- | ------------------- | ---------- | --------------------------------- |
| do\_action | post.create.booking | $data      | After the creation of new booking |
| do\_action | post.delete.booking | $data      | After deleting a booking          |
| do\_action | post.update.booking | $data      | After updating a booking data     |

**Customer Actions List**

| METHOD     | NAME                 | PARAMETERS | USE CASE                           |
| ---------- | -------------------- | ---------- | ---------------------------------- |
| do\_action | post.create.customer | $data      | After the creation of new customer |
| do\_action | post.delete.customer | $data      | After deleting a customer          |
| do\_action | post.update.customer | $data      | After updating a customer data     |

**Charge Actions List**

| METHOD     | NAME               | PARAMETERS | USE CASE                         |
| ---------- | ------------------ | ---------- | -------------------------------- |
| do\_action | post.create.charge | $data      | After the creation of new charge |
| do\_action | post.delete.charge | $data      | After deleting a charge          |
| do\_action | post.update.charge | $data      | After updating a charge data     |

**Payment Actions List**

| METHOD     | NAME                | PARAMETERS | USE CASE                          |
| ---------- | ------------------- | ---------- | --------------------------------- |
| do\_action | post.create.payment | $data      | After the creation of new payment |
| do\_action | post.delete.payment | $data      | After deleting a payment          |
| do\_action | post.update.payment | $data      | After updating a payment data     |

These are basically action triggers, you can add action listener like this:

```php
add_action('post.create.booking', 'your_callback_function', 10, 1);
function your_callback_function($data) {
  // this code will be executed on booking creation, $data will have booking related info
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.minical.io/build-an-extension/minical-actions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
