v0.2.0 - Design Editor: templates, patterns, header/footer variations
All checks were successful
Create Release Package / PHP Lint (push) Successful in 57s
Create Release Package / Build Release (push) Successful in 1m23s

Full Design Editor compatibility with custom block categories, page templates,
header/footer variations, and navigation styles. Both FSE (admin) and Twig
(frontend) sides kept in sync.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-02-08 16:05:29 +01:00
parent cb288d6e74
commit cc8dc9d357
53 changed files with 13863 additions and 39 deletions

View File

@@ -25,11 +25,13 @@ class ContextBuilder
public function build(): array
{
$context = [
'site' => $this->getSiteData(),
'menu' => $this->getMenuData('primary'),
'footer_menu' => $this->getMenuData('footer'),
'dark_mode' => true,
'layout' => 'default',
'site' => $this->getSiteData(),
'menu' => $this->getMenuData('primary'),
'footer_menu' => $this->getMenuData('footer'),
'dark_mode' => true,
'layout' => 'default',
'header_variant' => $this->getHeaderVariant(),
'footer_variant' => $this->getFooterVariant(),
];
if (is_singular()) {
@@ -448,6 +450,26 @@ class ContextBuilder
return $items;
}
/**
* Get the active header variant.
*
* @since 0.2.0
*/
private function getHeaderVariant(): string
{
return get_theme_mod('wp_bootstrap_header_variant', 'default');
}
/**
* Get the active footer variant.
*
* @since 0.2.0
*/
private function getFooterVariant(): string
{
return get_theme_mod('wp_bootstrap_footer_variant', 'default');
}
/**
* Get terms list for a taxonomy.
*/

View File

@@ -82,7 +82,14 @@ class TemplateController
}
if (is_page()) {
return 'pages/page.html.twig';
$slug = get_page_template_slug();
return match ($slug) {
'page-landing' => 'pages/landing.html.twig',
'page-full-width' => 'pages/full-width.html.twig',
'page-hero' => 'pages/hero.html.twig',
'page-sidebar' => 'pages/page-sidebar.html.twig',
default => 'pages/page.html.twig',
};
}
if (is_archive()) {