TEC Community Events Shortcode Test
";
echo "Plugin Status Check
";
$tec_active = is_plugin_active('the-events-calendar/the-events-calendar.php');
$tec_ce_active = is_plugin_active('the-events-calendar-community-events/tribe-community-events.php');
echo "The Events Calendar: " . ($tec_active ? '✓ Active' : '✗ Not Active') . "
";
echo "TEC Community Events: " . ($tec_ce_active ? '✓ Active' : '✗ Not Active') . "
";
$shortcode_exists = shortcode_exists('tribe_community_events');
echo "tribe_community_events shortcode: " . ($shortcode_exists ? '✓ Registered' : '✗ Not Registered') . "
";
// Check user status
if (is_user_logged_in()) {
$user = wp_get_current_user();
echo "Current User: {$user->user_login} (ID: {$user->ID})
";
echo "User Roles: " . implode(', ', $user->roles) . "
";
} else {
echo "⚠ Not logged in - this may affect form rendering
";
}
echo "";
// Test different shortcode variations
if ($shortcode_exists) {
$variations = [
'[tribe_community_events]' => 'Basic shortcode without parameters',
'[tribe_community_events view="submission_form"]' => 'Current implementation (with submission_form view)',
'[tribe_community_events view="form"]' => 'Alternative form view',
'[tribe_community_events view="edit"]' => 'Edit view without ID',
'[tribe_community_events view="submit"]' => 'Submit view variation',
'[tribe_community_events view="new"]' => 'New view variation'
];
foreach ($variations as $shortcode => $description) {
echo "";
echo "
Testing: $shortcode
";
echo "
$description
";
// Capture output and errors
ob_start();
$output = do_shortcode($shortcode);
$errors = ob_get_clean();
if (!empty($errors)) {
echo "
PHP Errors/Warnings:";
echo "
" . esc_html($errors) . "
";
}
echo "
";
if (empty(trim($output))) {
echo "
✗ No output generated";
} else {
// Check for form fields
$has_inputs = preg_match('/
]*type=["\'](?:text|email|url|tel|number|date|time|textarea)["\'][^>]*>/i', $output);
$has_textareas = preg_match('/
";
echo "
";
}
} else {
echo "";
echo "
Cannot Test Shortcode Variations
";
echo "
The tribe_community_events shortcode is not registered. Please ensure TEC Community Events plugin is properly activated.
";
echo "
";
}
// Additional debugging info
echo "";
echo "
Additional Debug Information
";
// Check if we're on the correct page type
echo "
Current page context:
";
echo "
";
echo "- is_admin(): " . (is_admin() ? 'true' : 'false') . "
";
echo "- is_page(): " . (is_page() ? 'true' : 'false') . "
";
echo "- is_single(): " . (is_single() ? 'true' : 'false') . "
";
echo "- Current query: " . get_query_var('pagename') . "
";
echo "
";
// Check for relevant classes/functions
$functions_to_check = [
'tribe_community_events_init',
'tribe_is_community_edit_event_page',
'Tribe__Events__Community__Main'
];
echo "
TEC Functions/Classes:
";
echo "
";
foreach ($functions_to_check as $func) {
if (strpos($func, 'Tribe__') === 0) {
$exists = class_exists($func);
$type = 'class';
} else {
$exists = function_exists($func);
$type = 'function';
}
echo "- $func ($type): " . ($exists ? '✓ Available' : '✗ Not Available') . "
";
}
echo "
";
echo "
";
?>
Next Steps
Based on the test results above:
- If no shortcode variations produce form fields, the issue is likely with TEC Community Events plugin configuration or permissions
- If some variations work better than others, update the HVAC plugin to use the working variation
- Check the WordPress admin for TEC Community Events settings that might restrict form display
- Ensure the current user has proper permissions to create events