PostTypes
  • PostTypes v2.2.1
  • Getting Started
  • PostTypes
    • Create a Post Type
    • Add Taxonomies
    • Filters
    • Columns
    • Menu Icons
    • Flush Rewrite Rules
  • Taxonomies
    • Create a Taxonomy
    • Add to Post Type
    • Columns
  • Notes
  • Contributing
  • Changelog
Powered by GitBook
On this page
  1. PostTypes

Filters

You can set what dropdown filters appear on the post type admin edit screen by passing an array of taxonomy names to the filters() method.

$books->filters( [ 'genre', 'category' ] );

The order the filters appear are set by the order of the items in the array.

// Display the category dropdown first.
$books->filters( [ 'category', 'genre' ] );

An empty array will remove all dropdown filters from the admin edit screen.

// Don't display filters on the admin edit screen.
$books->filters( [] );
PreviousAdd TaxonomiesNextColumns

Last updated 6 years ago