From 0e2bb0c139f97114c903a44737efeb1334490e10 Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 18 Aug 2025 14:58:17 -0300 Subject: [PATCH] fix: Force custom event edit template loading using page ID - Added page ID 6177 detection for reliability - Using multiple detection methods (page ID, slug, URL) - Works around WordPress limitation of not loading plugin templates via page template assignment --- includes/class-hvac-community-events.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/class-hvac-community-events.php b/includes/class-hvac-community-events.php index 38e8cf37..9de13b94 100644 --- a/includes/class-hvac-community-events.php +++ b/includes/class-hvac-community-events.php @@ -863,7 +863,8 @@ class HVAC_Community_Events { } // Check for new custom edit event page (hierarchical URL) - if (is_page() && strpos($_SERVER['REQUEST_URI'], '/trainer/event/edit') !== false) { + // Using multiple detection methods for reliability + if (is_page(6177) || is_page('trainer/event/edit') || (is_page() && strpos($_SERVER['REQUEST_URI'], '/trainer/event/edit') !== false)) { $custom_template = HVAC_PLUGIN_DIR . 'templates/page-edit-event-custom.php'; HVAC_Logger::info("Loading custom edit-event template", 'Template Loader'); }