fix: Prevent event creation content from appearing on registration page
The manage event JavaScript was running on all pages and injecting "Create Event" header and instructions into any page with matching content selectors. Added URL path checking to ensure the JavaScript only runs on the actual manage event pages. This fixes the issue where the registration page was showing event creation content instead of just the registration form. Co-Authored-By: Ben Reed <ben@tealmaker.com>
This commit is contained in:
parent
2cb37d0285
commit
2a0d2d2f7d
1 changed files with 13 additions and 0 deletions
|
|
@ -468,6 +468,19 @@ class HVAC_Manage_Event {
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener("DOMContentLoaded", function() {
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
|
// Check if we are on the manage event page
|
||||||
|
var currentPath = window.location.pathname.replace(/\/$/, "");
|
||||||
|
var isManagePage = (
|
||||||
|
currentPath === "/trainer/event/manage" ||
|
||||||
|
currentPath === "/manage-event" ||
|
||||||
|
currentPath === "/trainer-event-manage"
|
||||||
|
);
|
||||||
|
|
||||||
|
// Only inject content on the manage event page
|
||||||
|
if (!isManagePage) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Find the main content area
|
// Find the main content area
|
||||||
var contentArea = document.querySelector(".entry-content, .post-content, .page-content, main, .content");
|
var contentArea = document.querySelector(".entry-content, .post-content, .page-content, main, .content");
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue