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

@@ -37,6 +37,11 @@ class TemplateController
return;
}
// Allow plugins or child themes to prevent rendering for this request.
if (! apply_filters('wp_bootstrap_should_render_template', true)) {
return;
}
$template = $this->resolveTemplate();
if (! $template) {
return;