Plugins

The plugins we maintain for the Custom theme: what each one adds, how to set it up and which patterns build on it.

Table of Contents

Each plugin ships next to the themes as its own ZIP with its own version number. Install the ones a project needs under Plugins › Add New Plugin › Upload Plugin. Whether a feature belongs in the theme or in a plugin is decided under Extending.

  • Every plugin works on its own. Plugins may work together when both are active, but none requires another.
  • Every plugin uses the WordPress Abilities API. All of them offer their functions as abilities, so AI agents can configure them, and every new plugin has to as well. The abilities each plugin offers are listed in its readme.
  • Patterns stay in the theme. Patterns built on a plugin live in the Custom theme, which offers them only while the plugin is active.
  • The readme has the details. Every option, hook and constant of a plugin is described in the readme inside its ZIP.

WP Design System – Dialog

Buttons that open content of their own: a modal or non-modal dialog, or a disclosure that is part of the page, such as a menu, a search or a toggletip.

What it adds

  • Dialog, a block for a dialog: a modal one, which blocks and dims the rest of the page until it is closed, or a non-modal one over the page, which leaves the page usable and undimmed and closes on Escape, a click outside it or when the focus leaves it. Screen readers announce it as a dialog, named by its heading, and its button by its own text followed by that heading, so several buttons with the same text, such as Read CV in a team, stay apart.
  • Disclosure, a block for content that is part of the page and that its button describes, e.g. a menu, a search or a toggletip. It is no dialog for screen readers, as the WAI-ARIA Authoring Practices recommend for menus and searches.
  • The same two parts in both: the Trigger Button, a core Button that opens the content, and the content, which holds any blocks. One block transforms into the other, keeping both.
  • A reference point of your choice: on the browser window, in the center, at an edge or in a corner, in a size of your choice; or, for a non-modal dialog or a disclosure, below or above any block with an HTML anchor, aligned to its start, centered on it or aligned to its end, with a width in % as a share of the block’s width, e.g. a search as wide as the header below it. The browser positions it (CSS Anchor Positioning).
  • Mobile first in two stages: a disclosure can expand in the flow on small screens and, from a window width set per Disclosure, stand in the page or open over it, e.g. a menu that is a button on small screens and stands in the header on large ones, or a mega menu that is an accordion on small screens and a panel below the header on large ones. Without that width it is over the page at every width.
  • Icons on the button, one while it is closed and another while it is open, from the icon collections of the site.
  • Mega Menu Item, a menu item in a Navigation block whose panel shows a template part of the area Mega Menu, which the plugin adds: in the mobile menu the panel expands below its item, from the menu’s breakpoint on it opens below the header, one at a time.

The Dialog is a port of the Dialog block proposed for WordPress core, with the decisions of its reviews, so a modal Dialog can move to the core block once it ships.

Use cases

Each job maps to one setup. Where no pattern exists yet, build it from a Dialog or a Disclosure with these settings.

JobBlockReference pointBehavior small / largePattern
The menu of a headerDisclosure—In the flow / always visible, from the Disclosure’s BreakpointHeader 1 to 7
A search on demandDisclosure#site-header, 100% wideOver the pageHeader 2, 4, 5 and 7
A section’s second and third level in one panelMega Menu Item#site-header, 100% wideIn the flow / over the page, from the menu Disclosure’s BreakpointHeader 7, Mega Menu
A short explanation next to a term, a price or a field (toggletip)Disclosureits button, Above the reference point, centered, no close buttonOver the page—
A few links or options at a button (account, more actions)Disclosureits button, aligned to its endOver the page—
A menu behind a button at every width (drawer)Dialog, modalbrowser window, right, height 100%—Header 8
A form on request (callback, contact)Dialog, modalbrowser window, center—CTA 5
A signup opened from any link or campaign URLDialog, modal, with an HTML anchor, e.g. newsletterbrowser window—CTA 5, with an HTML anchor added
The full details of one item in a collection (a person’s CV, a job)Dialog, modal, per itembrowser window—Persons 2
A video that plays only on requestDialog, modalbrowser window—Video 2
A contact or help panel beside the pageDialog, non-modalbrowser window, right, or a block——

Not a job for either block: text that expands in the flow at every width (a Details or Accordion block), an image lightbox (WordPress’ Enlarge on click), a collapsible filter (the toggle of the Filter plugin) and switching between views (Tabs). A dialog that opens on a timer, on scrolling or on exit intent is left out on purpose, and so is a tooltip on hover.

Setting it up

  1. Install and activate the plugin.
  2. Insert a Dialog or a Disclosure, or a header pattern that has one. In the Dialog’s settings, choose whether it is modal or non-modal.
  3. Select the content, e.g. in the List View: it shows while it or a block in it is selected. Fill it, and set in its settings and toolbar how it behaves and where it opens; a Disclosure’s breakpoint and stages are there too. A dialog is named for screen readers by its first heading, otherwise by the Accessible label in those settings; its button adds that name to its own text, unless the text already holds it.
  4. To open a modal from a text or a menu, give the Dialog an HTML anchor in its Advanced settings and link to it, e.g. #newsletter. A page loaded with the anchor in its URL opens it too.
  5. For a mega menu, use Header 7: its two Mega Menu Items open the template parts Mega Menu 1 and 2 that come with the Custom theme; edit them in the Site Editor. For another panel, insert a Mega Menu Item into the header’s Navigation block, select it, and choose or create a template part of the area Mega Menu for its panel, e.g. from the Mega Menu patterns. The panel takes the breakpoint of the menu’s Disclosure. Its items and settings belong to the menu, not to the page: edit and save them in the Site Editor under Design → Navigation, since Save draft in a page’s editor saves the page only.

Patterns

FamilyThemePatterns
HeaderCustomheader-1-dynamic to header-7-dynamic: their menu is a Disclosure in the flow on small screens and always visible on large ones; in header-2-dynamic, header-4-dynamic, header-5-dynamic and header-7-dynamic the search opens over the page below the header (#site-header); header-7-dynamic has two Mega Menu Items in its main menu, which open the template parts Mega Menu 1 and 2; header-8-dynamic opens its menu at every width as a modal drawer on the right
Mega MenuCustommega-menu-1-static and mega-menu-2-dynamic: the content of the template parts Mega Menu 1 and 2, which Header 7 opens, and offered when another panel’s template part is created; mega-menu-2-dynamic adds a form on large screens only
CTACustomcta-5-static: its button opens a modal for what the action needs, such as a form
PersonsCustompersons-2-static: each person’s button opens the CV in a modal
VideoCustomvideo-2-static: a button on a preview image opens the video with its transcript in a modal, so the video loads only when played

Works with

  • The Custom theme: the menu, search and close icons of the headers come from it, and so does the colour of the backdrop. It lays a header out around its menu Disclosure: on small screens the button beside the logo and the menu expanding below it, from the Disclosure’s Breakpoint on the menu in the header itself. It dims the page around a header while one of its Disclosures is open; a modal dims with its own backdrop, a non-modal dialog not at all. It gives every dialog the rounded corners of a box, border radius 4; a drawer at the edge of the window sets them to 0, as Header 8 does. Its header patterns carry the HTML anchor site-header, the reference point of their search. It brings the template parts Mega Menu 1 and 2, which join the area Mega Menu while the plugin is active.

WP Design System – Filter

Filters the posts of a Query Loop by their terms, by a search word and by sort order, without reloading the page.

What it adds

  • Filter, a block inside a Query Loop: the terms of the loop’s posts as checkboxes, radio buttons or buttons, one filter group per taxonomy, side by side, in tabs or collapsible.
  • Its parts, blocks the Filter adds and removes in its settings: search, sort order, the selected filters as removable buttons, the number of results, a reset button and a toggle button that opens and closes the filter on small screens.
  • Counts per term: each term shows how many posts it leaves; terms that would leave none are disabled.

The selection lives in the URL, so a filtered list can be shared and the back button works. Without JavaScript the filter is a form with a submit button.

Setting it up

  1. Install and activate the plugin.
  2. Insert a Filter pattern and set the post type in its Query Loop. The patterns query the post type custom_post_type and the taxonomies custom-taxonomy-1 to -3 until you change them, so on a site without them they stay empty. filter-8-dynamic queries posts, pages and custom_post_type instead: set its post types in the panel Post types of its Multi Post Type Loop, and their order in the Filter groups panel.
  3. Choose the taxonomies in the Filter’s Filter groups panel. The filter groups follow the post type you set: the pattern’s groups give way to one for each taxonomy of your post type that has terms.
  4. Keep Reload full page switched off in the Query Loop: the filter replaces the list without reloading the page. The editor offers to switch it back on.

Patterns

FamilyThemePatterns
FilterCustomfilter-1-dynamic, filter-2-dynamic, filter-3-dynamic, filter-4-dynamic, filter-5-dynamic, filter-6-dynamic, filter-7-dynamic (also needs WP Design System – Map), filter-8-dynamic (also needs WP Design System – Multi Post Type Loop)
MapCustommap-5-dynamic, together with WP Design System – Map

Works with

  • WP Design System – Map: a Query Map in the same Query Loop shows only the posts the filter leaves and updates with every change. The patterns map-5-dynamic and filter-7-dynamic combine both.
  • WP Design System – Multi Post Type Loop: in a loop with several post types, the filter can offer the post types as a filter group of their own, in an order you set. The pattern filter-8-dynamic combines both.
  • Relevanssi: when it is active, the search field searches through Relevanssi.

WP Design System – Map

Shows the posts of a Query Loop on a map and switches the loop between its list and its map.

What it adds

  • Query Map, a block inside a Query Loop: the loop’s posts on an OpenStreetMap or Google map. It follows the loop’s settings, so a filter that narrows the loop narrows the map.
  • Map toggle buttons, a block inside a Query Loop: two buttons that switch between the list and the map.
  • A Location box in the editor, for the post types chosen in the settings.
  • Settings › Maps: the post types with a location, the map service, its keys and the map style.

The plugin is made for the Custom theme: the icons of the toggle buttons, grid and location, come from it.

Setting it up

  1. Install and activate the plugin.
  2. Under Settings › Maps, choose the post types whose posts have a location. Only they get the location box.
  3. Give each post a location in that box.
  4. Insert a Map pattern and set the post type in its Query Loop. The patterns query the post type custom_post_type until you change it, so on a site without it they stay empty.

Patterns

FamilyThemePatterns
MapCustommap-1-dynamic, map-2-dynamic, map-3-dynamic, map-4-dynamic, map-5-dynamic (also needs WP Design System – Filter)
FilterCustomfilter-7-dynamic, together with WP Design System – Filter

Works with

  • WP Design System – Filter: a filter in the same Query Loop narrows the map without reloading the page; map-5-dynamic and filter-7-dynamic combine a map, a list and a filter.
  • WP Design System – Events: when Events is chosen under Settings › Maps, events take their location from their venues and get no location box of their own. Without the Events plugin nothing changes.
  • WP Design System – Multi Post Type Loop: a Query Map inside a Multi Post Type Loop shows the posts of all its post types that have a location.

WP Design System – Multi Post Type Loop

Shows the posts of several post types in one Query Loop, for example posts, pages and a custom post type sorted together by date, optionally with a teaser of its own for each post type.

What it adds

  • Multi Post Type Loop, a variation of the Query Loop in the inserter category Theme. Post Template, pagination, No results, order and styles work as in the Query Loop; other Query Loops on the site are not touched.
  • Teaser for a Post Type, a block in the loop’s Post Template that holds the teaser of one post type. It is added and removed only through the loop’s settings, never through the inserter.

Setting it up

  1. Insert a Multi Post Type Loop, or turn a Query Loop into one under Transform to in its block toolbar. Transforming keeps the Post Template but starts the query over.
  2. Choose a pattern or a layout, as for a Query Loop. The plugin’s panels appear once the loop has content.
  3. In the panel Post types, tick the post types to show.
  4. In the panel Filters by post type, narrow them by taxonomy, parent, format or sticky posts. By default a filter narrows only the post types that have it: a category filter narrows the posts and leaves the pages complete. Switch to All post types to apply it to every post type, as a Query Loop does.
  5. To give a post type a teaser of its own, tick Dedicated teaser below it. The current teaser becomes the default for all other post types, and the new one starts as a copy of it.

Choosing a pattern or Change design keeps the variation but not its settings, so select the post types again afterwards. Without the plugin the block becomes a plain Query Loop with one of its post types, and every dedicated teaser shows one after another.

Patterns

FamilyThemePatterns
FilterCustomfilter-8-dynamic, together with WP Design System – Filter

For any other pattern, transform its Query Loop.

Works with

  • WP Design System – Map: a Query Map inside a Multi Post Type Loop shows the posts of all its post types that have a location.