- Fixed registration form redirect to use hierarchical URL (/trainer/registration/) - Removed inline styles from event manage page that were breaking theme layout - Added proper CSS styles for event manage header navigation - Created header component to properly display navigation on event manage page - Fixed manage event page detection to be more specific The event manage page now uses external CSS instead of inline styles that conflict with the theme. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
89 lines
No EOL
3.1 KiB
PHP
89 lines
No EOL
3.1 KiB
PHP
<?php
|
|
/**
|
|
* HVAC Event Manage Header
|
|
*
|
|
* @package HVACCommunityEvents
|
|
*/
|
|
|
|
if (!defined('ABSPATH')) {
|
|
exit;
|
|
}
|
|
|
|
/**
|
|
* Class to handle event management page header
|
|
*/
|
|
class HVAC_Event_Manage_Header {
|
|
|
|
/**
|
|
* Constructor
|
|
*/
|
|
public function __construct() {
|
|
add_action('tribe_events_community_before_event_submission_page', array($this, 'render_header'));
|
|
add_filter('the_content', array($this, 'add_header_to_event_manage_page'), 5);
|
|
}
|
|
|
|
/**
|
|
* Add header to event manage page content
|
|
*/
|
|
public function add_header_to_event_manage_page($content) {
|
|
// Only add on event manage pages
|
|
if (!is_page('trainer/event/manage') && !is_page('manage-event') && !is_page('trainer-event-manage')) {
|
|
return $content;
|
|
}
|
|
|
|
// Check if we're displaying the tribe community events form
|
|
if (strpos($content, 'tribe_community_events') === false && strpos($content, 'tribe-community-events') === false) {
|
|
return $content;
|
|
}
|
|
|
|
// Get the header HTML
|
|
$header = $this->get_header_html();
|
|
|
|
// Add header before the content
|
|
return $header . $content;
|
|
}
|
|
|
|
/**
|
|
* Render the header
|
|
*/
|
|
public function render_header() {
|
|
echo $this->get_header_html();
|
|
}
|
|
|
|
/**
|
|
* Get the header HTML
|
|
*/
|
|
private function get_header_html() {
|
|
ob_start();
|
|
?>
|
|
<!-- Navigation Header -->
|
|
<div class="hvac-dashboard-header">
|
|
<h1 class="entry-title">Create Event</h1>
|
|
<div class="hvac-dashboard-nav">
|
|
<a href="/trainer/dashboard/" class="ast-button ast-button-secondary">Dashboard</a>
|
|
<a href="/trainer/certificate-reports/" class="ast-button ast-button-secondary">Certificate Reports</a>
|
|
<a href="/trainer/generate-certificates/" class="ast-button ast-button-secondary">Generate Certificates</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="hvac-event-manage-header">
|
|
<h2>Create and Manage Your HVAC Training Events</h2>
|
|
<p>Use this form to create new training events or edit existing ones. Please fill out all required fields to ensure your event is properly listed and attendees receive accurate information.</p>
|
|
<div class="hvac-event-manage-tips">
|
|
<h3>Event Creation Tips:</h3>
|
|
<ul>
|
|
<li><strong>Event Title:</strong> Use a clear, descriptive title that indicates the training topic</li>
|
|
<li><strong>Date & Time:</strong> Ensure you select the correct timezone for your location</li>
|
|
<li><strong>Description:</strong> Provide detailed information about what attendees will learn</li>
|
|
<li><strong>Capacity:</strong> Set an appropriate maximum number of attendees</li>
|
|
</ul>
|
|
</div>
|
|
<hr style="margin: 20px 0;">
|
|
</div>
|
|
<?php
|
|
return ob_get_clean();
|
|
}
|
|
}
|
|
|
|
// Initialize
|
|
new HVAC_Event_Manage_Header();
|