Fix Filter Term Hierarchy When Parent Is Not Selected
This snippet corrects the hierarchy of Checkbox and Radio filters in JetSmartFilters. If a parent term is missing or not selected, its child terms are automatically moved to the top level, preventing empty or broken filter structures.
Specifications
Fix Filter Term Hierarchy When Parent Is Not Selected
7 January, 2026
-
Plugin
-
Category
-
Programming languages
Installing Instruction
How to Add Snippets into the functions.php File of the Active Child Theme
- Copy the required code snippet to your clipboard.
- Navigate to WordPress Dashboard > Appearance > Theme File Editor.
- Click the functions.php tab to open the file.
- Paste the code snippet below the existing code in the Selected file content: area.
- Click the "Update File" page.
Example Use Case
Use this snippet to correct filter hierarchy in JetSmartFilters where missing first-level terms cause child terms to break filter structures.
Applicable scenarios:
- Product and content filtering: Ensure reliable, clear filter hierarchies.
- E-commerce or directories: Present clean Checkbox and Radio filters even with no parent categories selected.
- Filtering UX: Maintain user-friendly filtering with logical hierarchy fixes.
Specifications
Fix Filter Term Hierarchy When Parent Is Not Selected
7 January, 2026
-
Plugin
-
Category
-
Programming languages