[benecaster_faq]
Renders FAQ entries from the benecaster_faq CPT. Two modes:
Static mode (default) — renders a server-side list of FAQs filtered by context, tags, and optionally grouped by category. Supports accordion expand/collapse.
Search mode (search="true") — replaces the server-rendered list with an AJAX-driven search UI backed by the unified /docs-search endpoint (type=faq). Renders a text input plus a chip filter carrying every FAQ category. Results render as accordions (or flat headings when accordion="false"). Debounced 400 ms on keystroke; chip clicks trigger an immediate fetch. Empty query + no category chip selected shows a helper hint rather than fetching all FAQs. The category shortcode attribute and ?category= URL param both seed the initial active chip (URL param wins when both are set); when seeded, an initial search fires on page load. In search mode the context and tags attributes are ignored — search mode covers all published FAQs.
Parameters
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
context |
string |
— | No | Filter FAQs to those tagged with this page-context slug (e.g. 'plans', 'migration'). Ignored in search mode. |
tags |
string |
— | No | Comma-separated list of tag slugs. Only FAQs matching all listed tags are shown. Ignored in search mode. |
show_filter |
bool |
true
|
No | Whether to show the category chip filter. Set to false for tightly scoped context embeds. Ignored in search mode (filter is always shown). |
accordion |
bool |
true
|
No | Whether to render results as expandable accordions. When false, answers render as flat blocks below each question heading. |
search |
bool |
false
|
No | Enable AJAX search mode. When true, the static server-rendered FAQ list is replaced with a live search UI. The context and tags attributes are ignored in search mode. The category attribute seeds the initial active chip. |
category |
string |
— | No | In search mode: seeds the initially selected category chip and triggers a search on page load. The ?category= URL param also seeds this and takes priority. In static mode: filters to a single category. |