---
title: "Custom taxonomy for filter"
date: 2018-09-09
author: "nK"
---

# Custom taxonomy for filter

## A. Method with PHP code

There is an available filer **vpf\_allow\_taxonomy\_for\_filter** that allows you to use custom taxonomy as a filter. Example:

```
<?php

add_filter( 'vpf_allow_taxonomy_for_filter', 'my_filter_vpf_allow_taxonomy_for_filter', 10, 2 );

function my_filter_vpf_allow_taxonomy_for_filter( $allow, $taxonomy ) {
    if ( 'my_custom_taxonomy' === $taxonomy ) {
        $allow = true;
    }
    return $allow;
}
```

## B. Method with settings

You can add a custom taxonomy slug in the plugin settings. Example:

![](https://www.visualportfolio.com/wp-content/uploads/2024/07/Shot-2024-07-15-at-20.19.27-1024x600.png)![](https://www.visualportfolio.com/wp-content/uploads/2024/07/Shot-2024-07-15-at-20.19.27-1024x600.png)