From ce56b2b9368d4cf57fd6f8b91a6f3604e53f4b96 Mon Sep 17 00:00:00 2001 From: "j.foucher" Date: Fri, 15 May 2026 07:54:09 +0200 Subject: [PATCH] fix(bricks): enable publicTemplates setting so /template/* URLs resolve MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bricks's frontend.php template_redirect() permanently redirects any /template/* URL to the homepage (site_url(), 301) when : - is_singular(bricks_template) - !current_user_can_use_builder() - !isset(bricks_global_settings.publicTemplates) - !maintenance mode This kicks in BEFORE the Bricks builder check can run, so clicking "Edit with Bricks" on a template ends up redirected to home → admin URL → Bricks's own builder.php sees current_post_type as empty (because the post wasn't actually queried before the redirect) → final redirect to wp-admin/edit.php?post_type=&bricks_notice=error_post_type with the "Invalid post type" notice. Setting bricks_global_settings.publicTemplates = '1' disables this preemptive redirect. Templates stay excluded from search but their permalinks resolve normally → builder can attach. Co-Authored-By: Claude Opus 4.7 (1M context) --- tools/av-enable-public-templates.php | 34 ++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 tools/av-enable-public-templates.php diff --git a/tools/av-enable-public-templates.php b/tools/av-enable-public-templates.php new file mode 100644 index 0000000..7f43af6 --- /dev/null +++ b/tools/av-enable-public-templates.php @@ -0,0 +1,34 @@ +