v4.4.6 - WooCommerce Email Preview Fix
🎯 CRITICAL FIX: Email preview now shows email content instead of WordPress admin backend
Root Cause Identified
After comprehensive debugging with WordPress debug logs, we discovered the real issue:
- The
admin_body_classfilter was NOT being called when the email preview iframe loaded - This meant the CSS hiding rules never triggered
- Even though detection worked perfectly, the CSS was never applied at the right time
Solution
Inject the admin shell hiding CSS DIRECTLY via the admin_head hook when email preview is detected. This completely bypasses the body class dependency and ensures the rules execute before any page rendering.
What Changed
- Removed early return in admin_head hook
- Added direct CSS injection for email preview cases
- CSS now injects inline before page render
- Body class filter still works for normal pages (not removed)
Testing
✅ Detection works
✅ CSS now injects at correct time
✅ Admin shell should now be hidden in email preview
Update now to v4.4.6 and test the email preview!