Admin Filters Overview
From this tutorial, you will learn how to use JetEngine’s Admin Filters to organize Custom Post Types and what makes it so useful.
Taxonomy Admin Filter
This filter works with taxonomies created within the Custom Post Type.
- Title/Placeholder — a name of the filter that may also be used as a placeholder on the posts page;
- Use Title as Placeholder — a switcher that enables the feature described above. Once toggled, the filter title will be added to the drop-down list as the first option. Otherwise, the filter will display only the options that can be found according to the following settings;
- Type — a data source used for filtering items. Choose between two options, which are taxonomy and meta data;
- Taxonomy — a source for posts filtering;
- Show Hierarchy — a switcher that becomes available if the chosen taxonomy is set as hierarchical. It enables the term nesting display for hierarchical filters;
- Show Counts — a toggle that displays the count of the posts when enabled.
Meta Data Admin Filter
Glossary options source
Check more information about Glossaries to understand better when you may need to implement customizations similar to the ones described further.
In case you have already created Glossary, you may want to use this type of Admin Filters.
The following filter’s main peculiarity is the “Filter by meta data” Type and “Glossary” Options Source.
Check the fields that differ from the filter where “Filter by taxonomy” is selected as the Type:
- Meta Field — a drop-down menu that lets you choose the meta field to use as the source for filtering;
- Custom Meta Field — a field for the meta field key that overrides the Meta Field. If the JetEngine’s meta field is selected and a custom one is entered, filtering will occur by the custom field;
- Options Source — a drop-down list that defines the source for pulling options. Now we will set the “Glossary” option;
- Glossary — a list that shows available glossaries that can be picked as the filtering source.
Mind that if you are using the date timestamp field, there can be issues with its data display. Read more about problem fixing.
Database options source
The third filter we create is also set to be the “Filter by meta data” Type. Nonetheless, in the present case, we set “Select from database” as the Options Source.
Firstly, you should add a meta field to the Custom Post Type to use this filter. Don’t forget to save the changes by hitting the “Update Post Type” button.
Then fill it out while editing the post from the updated Custom Post Type. The completed information will be pulled up as the source for the filter.
This option pulls the information from the existing Post Type Meta Fields, meaning that it will be automatically found in the database.
For now, we have discovered all the available filtering options. Go to the Custom Post Type you worked on and see if created filters are displayed.
Custom Post Type Filtering in Action
As you can see, all the filters should now be shown above the existing posts. Open the first drop-down menu.
When opened, you will see that the number of filtered options is displayed if you have toggled the Show Counts option while creating the Admin Filter.
The following drop-down menu filters posts by a specific glossary.
The last customized filter pulls its options from the database directly.
That’s it. Now you know how Admin Filters work. Since this moment, the customization process of JetEngine-built CPTs will become much faster.