Shortcode Registration Debug
Registered Shortcodes";
$hvac_shortcodes = [];
foreach ($shortcode_tags as $tag => $callback) {
if (strpos($tag, 'hvac_') === 0 || strpos($tag, 'tribe_') === 0) {
$hvac_shortcodes[$tag] = $callback;
}
}
if (empty($hvac_shortcodes)) {
echo "No HVAC or TEC shortcodes found!
";
} else {
echo "";
echo "| Shortcode | Callback | Test |
";
foreach ($hvac_shortcodes as $tag => $callback) {
echo "";
echo "[$tag] | ";
if (is_array($callback)) {
$class = is_object($callback[0]) ? get_class($callback[0]) : $callback[0];
echo "$class::{$callback[1]}() | ";
} else {
echo "$callback | ";
}
// Test the shortcode
echo "";
if ($tag === 'hvac_create_event' || $tag === 'hvac_edit_event') {
ob_start();
$output = do_shortcode("[$tag]");
$errors = ob_get_clean();
if ($errors) {
echo "PHP Errors";
} elseif (strlen($output) > 100) {
echo "Renders (" . strlen($output) . " chars)";
} elseif (strlen($output) > 0) {
echo "Short output (" . strlen($output) . " chars)";
} else {
echo "No output";
}
} else {
echo "Not tested";
}
echo " | ";
echo "
";
}
echo "
";
}
// Test specific shortcodes
echo "Direct Tests
";
echo "Testing [hvac_create_event]
";
if (shortcode_exists('hvac_create_event')) {
ob_start();
$create_output = do_shortcode('[hvac_create_event]');
$create_errors = ob_get_clean();
if ($create_errors) {
echo "Errors:" . esc_html($create_errors) . "
";
}
if (strlen($create_output) > 0) {
echo "Output length: " . strlen($create_output) . " characters
";
echo "Contains TEC form: " . (strpos($create_output, 'tribe-events') !== false ? 'Yes' : 'No') . "
";
echo "Contains error: " . (strpos($create_output, 'required but not active') !== false ? 'Yes' : 'No') . "
";
} else {
echo "No output generated
";
}
} else {
echo "hvac_create_event shortcode not registered
";
}
echo "Testing [hvac_edit_event]
";
if (shortcode_exists('hvac_edit_event')) {
ob_start();
$edit_output = do_shortcode('[hvac_edit_event]');
$edit_errors = ob_get_clean();
if ($edit_errors) {
echo "Errors:" . esc_html($edit_errors) . "
";
}
if (strlen($edit_output) > 0) {
echo "Output length: " . strlen($edit_output) . " characters
";
echo "Contains TEC form: " . (strpos($edit_output, 'tribe-events') !== false ? 'Yes' : 'No') . "
";
echo "Contains error: " . (strpos($edit_output, 'required but not active') !== false ? 'Yes' : 'No') . "
";
} else {
echo "No output generated
";
}
} else {
echo "hvac_edit_event shortcode not registered
";
}
echo "Testing [tribe_community_events]
";
if (shortcode_exists('tribe_community_events')) {
echo "tribe_community_events shortcode is registered
";
ob_start();
$tec_output = do_shortcode('[tribe_community_events view="submission_form"]');
$tec_errors = ob_get_clean();
if ($tec_errors) {
echo "Errors:" . esc_html($tec_errors) . "
";
}
echo "Output length: " . strlen($tec_output) . " characters
";
if (strlen($tec_output) > 500) {
echo "Substantial output generated - likely working
";
} elseif (strlen($tec_output) > 0) {
echo "Some output generated
";
} else {
echo "No output from TEC shortcode
";
}
} else {
echo "tribe_community_events shortcode NOT registered - TEC plugin issue
";
}
?>