> For the complete documentation index, see [llms.txt](https://docs.minical.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.minical.io/build-an-extension/minical-filters.md).

# miniCal Filters

Filters are functions that always accept data in the form of an Argument and, after processing again, return the data as Return Value. The filter itself means the process of filtering something out. Just like the do\_action, here we have the apply\_filters() function.

```php
$filtered_value = apply_filters('example_filter_to_run', $arg );
```

So, now the $filtered\_value will be the system-generated output until you add a filter on it. In order, add the filter you need to call add\_filter() just like the add\_action(). Below is the example :

```php
// The filter callback function is based on the filter.

add_filter( ‘example_filter_to_run’, ‘example_callback_fun’, 10, 1 );

function example_callback_fun($arg) {
// code
return $arg;
}
```

**Customer Filters List**

| METHOD         | NAME                 | PARAMETERS | USE CASE                           |
| -------------- | -------------------- | ---------- | ---------------------------------- |
| apply\_filters | post.add.customer    | $data      | After the creation of new customer |
| apply\_filters | post.update.customer | $data      | After updating a customer          |

**Payment Source Filters List**

| METHOD         | NAME                        | PARAMETERS | USE CASE                                            |
| -------------- | --------------------------- | ---------- | --------------------------------------------------- |
| apply\_filters | post.create.payment\_source | $data      | After the creation of customer's new payment source |
| apply\_filters | post.update.payment\_source | $data      | After updating a customer's payment source          |
| apply\_filters | post.delete.payment\_source | $data      | After deleting a customer's payment source          |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
