upskill-event-manager/scripts/clear-manage-event-cache.sh
bengizmo 0a627a6a1f fix: Remove persistent HTML comment from manage event page
- Modified page-manage-event.php template to access raw post content directly
- Added comprehensive regex patterns to strip all variations of wp:shortcode comments
- Disabled the_content filter in HVAC_Manage_Event class to prevent conflicts
- Added client-side JavaScript fallback to remove any remaining HTML comments
- Created cache clearing script for troubleshooting

The issue was that apply_filters('the_content') was potentially re-adding
content after we stripped the HTML comments. Now we bypass all filters
and process the raw content directly.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-30 11:27:58 -03:00

41 lines
No EOL
1.4 KiB
Bash
Executable file

#!/bin/bash
echo "=== Clearing cache for manage event page ==="
# Try to clear Breeze cache if available
if command -v wp &> /dev/null; then
echo "Clearing WordPress cache..."
wp cache flush 2>/dev/null || echo " - WordPress cache flush not available"
echo "Clearing Breeze cache..."
wp breeze purge --cache=all 2>/dev/null || echo " - Breeze cache purge not available"
echo "Clearing transients..."
wp transient delete --all 2>/dev/null || echo " - Transient deletion not available"
else
echo "WP-CLI not found. Manual cache clearing may be needed."
fi
# Clear object cache files if they exist
if [ -d "/tmp/breeze" ]; then
echo "Clearing Breeze file cache..."
rm -rf /tmp/breeze/*
fi
# Clear any server-side caches
if command -v redis-cli &> /dev/null; then
echo "Flushing Redis cache..."
redis-cli FLUSHALL 2>/dev/null || echo " - Redis flush failed or not configured"
fi
if command -v service &> /dev/null; then
echo "Restarting PHP-FPM (if available)..."
sudo service php*-fpm restart 2>/dev/null || echo " - PHP-FPM restart not available"
fi
echo "Cache clearing complete!"
echo ""
echo "Next steps:"
echo "1. Visit the manage event page in an incognito/private browser window"
echo "2. Check if the HTML comment is still appearing"
echo "3. If it still appears, the issue is likely in The Events Calendar plugin itself"