Skip to content

1.0.3: Give plugins a place to draw and a vocabulary for where

Choose a tag to compare

@bobicloudvision bobicloudvision released this 11 Sep 09:26
· 6 commits to main since this release
A plugin's pages waited for somebody to go and look at them. Slots are the
other half: a line in the footer, a note under the navigation, a warning above
every admin page. $plugin->slot() answers one, and what it returns is a page
description, so there is nothing new to learn about what a slot may contain.

SlotPosition is the catalogue of where. It is written out here, all sixty-two
of them, rather than being whatever the panel happens to render with: a plugin
that declares "footer" should keep drawing in the footer for as long as the
panel has one, whoever built the layer underneath by then. The panel keeps the
map from these names to its own view layer, and a change of view layer moves
that map rather than every plugin in the wild.

Names are added and never repurposed, exactly as hook names are. Three kinds
of position are deliberately missing: the document head, the script block and
the stylesheet block take markup and nothing else, and a plugin sends a
description rather than markup.

The manifest validates a slot the way it validates a page, and a position with
a typo in it is told what was probably meant, because "sidebar.nav.ends" is a
mistake somebody will make more than once.