Skip to content

Instantly share code, notes, and snippets.

@arenagroove
Last active December 3, 2025 06:00
Show Gist options
  • Select an option

  • Save arenagroove/a2755d8bfe25fa36f5c3f744e98f95fa to your computer and use it in GitHub Desktop.

Select an option

Save arenagroove/a2755d8bfe25fa36f5c3f744e98f95fa to your computer and use it in GitHub Desktop.
Fix WordPress 6.9+ CSS Loading Issue (Classic Editor + ACF + WPForms)
/**
* Plugin Name: LR Classic Editor Compatibility
* Plugin URI: https://www.lessrain.com
* Description: Ensures proper CSS loading for Classic Editor, ACF, and shortcode-based content in WordPress 6.9+.
* Author: Luis Martinez
* Author URI: https://www.lessrain.com
* Version: 1.0.0
*/
// Prevent direct access
if (!defined('ABSPATH')) {
exit;
}
/**
* Fix WordPress 6.9+ CSS Loading Issue
*
* WordPress 6.9 introduced an optimization that only loads CSS for blocks
* actually used on a page. This breaks styling for:
* - Classic Editor content (no block markup)
* - ACF fields (dynamically rendered)
* - Shortcodes like WPForms (not recognized as blocks)
*
* This filter disables the optimization, restoring pre-6.9 behavior where
* all CSS loads unconditionally.
*
* @since 1.0.0
* @see https://core.trac.wordpress.org/ticket/64099
*/
add_filter('should_load_separate_core_block_assets', '__return_false');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment