diff --git a/wordpress-dev/wordpress/wp-content/plugins/hvac-community-events/includes/class-hvac-community-events.php b/wordpress-dev/wordpress/wp-content/plugins/hvac-community-events/includes/class-hvac-community-events.php index 89b73572..fe27ac05 100644 --- a/wordpress-dev/wordpress/wp-content/plugins/hvac-community-events/includes/class-hvac-community-events.php +++ b/wordpress-dev/wordpress/wp-content/plugins/hvac-community-events/includes/class-hvac-community-events.php @@ -304,8 +304,8 @@ class HVAC_Community_Events { // Add certificate fix shortcode (admin only) add_shortcode('hvac_certificate_fix', array($this, 'render_certificate_fix')); - // Add community events shortcode as fallback if TEC CE is not available - add_shortcode('tribe_community_events', array($this, 'render_tribe_community_events')); + // Removed shortcode override - let The Events Calendar Community Events handle this shortcode + // add_shortcode('tribe_community_events', array($this, 'render_tribe_community_events')); // Add future shortcodes here } @@ -629,178 +629,9 @@ class HVAC_Community_Events { return $template; } // End load_custom_templates - /** - * Render tribe community events shortcode - */ - public function render_tribe_community_events($atts) { - // Parse shortcode attributes - $atts = shortcode_atts(array( - 'view' => 'submission_form' - ), $atts); - - // Check if user is logged in - if (!is_user_logged_in()) { - return '

Please log in to access this feature.

'; - } - - // Check if user has permission - if (!current_user_can('hvac_trainer') && !current_user_can('edit_posts')) { - return '
You do not have permission to access this feature.
'; - } - - // Check if TEC Community Events is active and working - if (class_exists('Tribe__Events__Community__Main')) { - // Check if the TEC shortcode handler exists - global $shortcode_tags; - $tec_handler = null; - - // Look for TEC's original handler - if (isset($shortcode_tags['tribe_community_events'])) { - $current_handler = $shortcode_tags['tribe_community_events']; - - // If it's our handler, temporarily remove it to find TEC's - if ($current_handler === array($this, 'render_tribe_community_events')) { - remove_shortcode('tribe_community_events'); - - // Try to get TEC's handler by calling their main class - if (class_exists('Tribe__Events__Community__Shortcodes')) { - $tec_shortcodes = new Tribe__Events__Community__Shortcodes(); - if (method_exists($tec_shortcodes, 'tribe_community_events')) { - $tec_handler = array($tec_shortcodes, 'tribe_community_events'); - } - } - - // If we found TEC's handler, use it - if ($tec_handler && is_callable($tec_handler)) { - $output = call_user_func($tec_handler, $atts); - - // Re-add our handler for next time - add_shortcode('tribe_community_events', array($this, 'render_tribe_community_events')); - - if (!empty($output) && !is_wp_error($output)) { - return $output; - } - } - - // Re-add our handler if TEC didn't work - add_shortcode('tribe_community_events', array($this, 'render_tribe_community_events')); - } - } - } - - // Handle different views - switch ($atts['view']) { - case 'submission_form': - return $this->render_event_submission_form(); - default: - return '
Unknown view: ' . esc_html($atts['view']) . '
'; - } - } - - /** - * Render event submission form - */ - private function render_event_submission_form() { - ob_start(); - ?> -
- -
-

Create New Training Event

- -
- -
- -
-

Notice: The Events Calendar Community Events plugin is not active. Using basic event creation form.

-

For full event management features, please contact your administrator to activate The Events Calendar Community Events plugin.

-
- -

Fill out the form below to create a new training event. All events are reviewed before being published.

-
- -
-

Instructions

- -
- - - -
- - -
- - -
- -
- - -
- -
-
- - -
-
- - -
-
- -
-
- - -
-
- - -
-
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - Return to Dashboard -
-
-
-