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
This commit is contained in:
Ben 2025-08-18 14:58:17 -03:00
parent 0b854a8c5b
commit 0e2bb0c139

View file

@ -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');
}