feat: add wp_bootstrap_should_render_template filter for plugin decoupling (v1.0.4)
All checks were successful
Create Release Package / PHP Lint (push) Successful in 1m29s
Create Release Package / Build Release (push) Successful in 1m40s

Allows plugins and child themes to prevent the theme's TemplateController
from rendering specific requests, enabling clean separation of concerns.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-02-11 11:48:08 +01:00
parent e3e9b9f2be
commit b285d75878
5 changed files with 35 additions and 3 deletions

View File

@@ -84,7 +84,7 @@ The theme uses a dual-rendering approach:
- **Site Editor (admin):** FSE block templates in `templates/` and `parts/` for visual editing
- **Frontend (public):** Twig templates in `views/` render Bootstrap 5 HTML via the `template_redirect` hook
The `TemplateController` intercepts frontend requests and renders the appropriate Twig template with data gathered by `ContextBuilder`. FSE templates remain untouched for the WordPress admin editor.
The `TemplateController` intercepts frontend requests and renders the appropriate Twig template with data gathered by `ContextBuilder`. Plugins can hook into the `wp_bootstrap_should_render_template` filter to prevent rendering for specific requests (e.g., when a plugin handles its own custom post types). FSE templates remain untouched for the WordPress admin editor.
### Style Variation Bridge