> For the complete documentation index, see [llms.txt](https://posttypes.jjgrainger.co.uk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://posttypes.jjgrainger.co.uk/post-types/define-filters.md).

# Define filters

Filters that appear for the post type listing admin screen can be defined using the `filters()` method.

This must return an array of taxonomy slugs that are to be used as dropdown filters for the post type.

By default, an empty array is returned.

```php
use PostTypes\PostType;

class Books extends PostType
{
    //...

    /**
     * Returns the filters for the Books post type.
     *
     * @return array
     */
    public function filters(): array
    {
        return [
            'category',
        ];
    }
}
```
