-
Notifications
You must be signed in to change notification settings - Fork 0
Facet Type Toggle
SHEPDESIGN edited this page Jun 4, 2026
·
3 revisions
A single boolean filter. "On sale." "In stock." "Free shipping." On or off.
A switch or single checkbox that filters results down to items matching a single boolean condition. Off = no filter applied. On = only matching items shown.
- "On sale only"
- "In stock only"
- "Free shipping"
- "Featured products"
- Any binary state filter
- Multiple states (on/off/either) → use Radio with three options
- The "either" state matters → use Radio
- Multi-value flags → use Checkbox
{
"name": "in_stock",
"kind": "meta",
"source": "_stock_status",
"display": "toggle",
"label": "In stock only",
"settings": {
"true_value": "instock",
"on_label": "In stock",
"off_label": "Off"
}
}| Field | Values | Default | What |
|---|---|---|---|
kind |
"taxonomy" | "meta" | "field"
|
— | Where the indexed value comes from |
source |
string | — | The taxonomy slug or meta/field key |
settings.true_value |
string | "1" |
The exact facet_value the index stores for matching items. Typically 1 for boolean meta, or e.g. instock
|
settings.on_label |
string | facet label | Label shown for the ON state |
settings.off_label |
string | "Off" |
Label shown for the OFF state |
When on, the facet filters to items whose indexed value equals true_value; when off, the facet is cleared (no filter).
?hof[in_stock]=instock
The param carries true_value when on. Absent param means OFF (no filter).
WooCommerce in-stock filter:
{ "name": "in_stock", "kind": "meta", "source": "_stock_status",
"display": "toggle", "settings": { "true_value": "instock" } }Boolean featured-flag filter:
{ "name": "featured", "kind": "meta", "source": "_featured",
"display": "toggle", "settings": { "true_value": "yes", "on_label": "Featured only" } }hooked on facets · Filtering, finally fun. · GitHub · hookedonfacets.com
Filtering, finally fun.
📖 docs
🧠 concepts
🎛️ facet types
- All Types
- Checkbox
- Radio
- Dropdown
- Range Slider
- Date Range
- Search
- Hierarchy
- Color Swatch
- Swipe Deck
- Spin the Wheel
- Intersection Matrix
- Ask
- Visual DNA
- Toggle
- Saved Bin
- Pagination
🔧 develop
🗺️ project