Build on LanternWP
How the LanternWP theme, WooCommerce and the Companion plugin fit together, and what we keep working between versions.
These docs are for developers and agencies building stores on LanternWP, and for the AI tools they work with.
How it fits together
- The theme is on WordPress.org and works alone: templates, template parts, patterns,
theme.jsonand style variations, plus small Interactivity API scripts. It uses WooCommerce's blocks, never Companion's. - WooCommerce is required for the store: its blocks and data cover the catalog, filters, cart, checkout and account. The theme styles and extends them before it would replace anything.
- LanternWP Companion comes from lanternwp.com and is optional: blocks WooCommerce lacks, placed by Block Hooks; the demo import; the price history behind the lowest price before a discount.
What we keep stable
Only the names in the public API are a promise. Everything else, including PHP class names and the markup of patterns, is internal and may change in any release.
Where to begin
Child themes
Build a client's store as a child theme of LanternWP that keeps its updates.
- Public API: The names in LanternWP and LanternWP Companion your code can build on, and how they change.
Extending
- HooksThe filters LanternWP and LanternWP Companion offer for the theme's screen, the store's details and the demos, with examples.
- Companion's blocksThe blocks LanternWP Companion places with Block Hooks, where they go and how to move or remove them.
- WP-CLIImport a demo store, or only its look, from the command line with wp lanternwp demo, and connect the site to a lanternwp.com account for its private demos.
- Features REST routeRead and save Companion's features, their switches and their settings, with lanternwp/v1/features.
Reference
- PatternsEvery pattern LanternWP registers, by slug, with where the editor offers it.
- Templates and partsThe templates and template parts LanternWP ships, by file name.
- theme.json presetsThe slugs and values of LanternWP's colors, fonts, font sizes, spacing and shadows.
- Companion's blocks referenceLanternWP Companion's blocks from their block.json: names, attributes and where Block Hooks place them.
- Hooks referenceEvery hook LanternWP and LanternWP Companion call, from the docblocks above their calls.
- WP-CLI referenceThe options of LanternWP Companion's WP-CLI commands, from their docblocks.