Changeset 3293437
- Timestamp:
- 05/14/2025 05:21:04 PM (8 months ago)
- Location:
- custom-css-to-external-file/trunk
- Files:
-
- 2 edited
-
custom-css-to-external-file.php (modified) (3 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
custom-css-to-external-file/trunk/custom-css-to-external-file.php
r3290004 r3293437 4 4 Plugin URI: https://vortica.net/custom-css-to-external-file 5 5 Description: Moves the Custom CSS from the WordPress Customizer to an external file and includes it in the site's head to improve performance and persistence. 6 Version: 2.06 Version: 3.0 7 7 Author: Vortica 8 8 Author URI: https://vortica.net/ … … 17 17 function ccsef_activate_plugin() { 18 18 update_option('ccsef_external_active', 1); 19 ccsef_save_customizer_css_to_file(); // Save CSS to file immediately19 ccsef_save_customizer_css_to_file(); 20 20 } 21 21 register_activation_hook(__FILE__, 'ccsef_activate_plugin'); … … 38 38 add_action('customize_save_after', 'ccsef_save_customizer_css_to_file'); 39 39 40 // Enqueue the external CSS file instead of inline40 // Enqueue the external CSS file (not during Customizer live preview) 41 41 function ccsef_enqueue_customizer_css_file() { 42 // Do not include external CSS during Customizer live preview 43 if ( is_customize_preview() ) return; 44 42 45 $is_active = get_option('ccsef_external_active', false); 43 46 if (!$is_active) return; 44 47 45 // Only remove inline CSS when not in Customizer live preview 46 if ( ! is_customize_preview() ) { 47 remove_action('wp_head', 'wp_custom_css_cb', 101); 48 } 48 // Remove default inline CSS output 49 remove_action('wp_head', 'wp_custom_css_cb', 101); 49 50 50 51 $upload_dir = wp_upload_dir(); -
custom-css-to-external-file/trunk/readme.txt
r3293423 r3293437 5 5 Tested up to: 6.8.1 6 6 Requires PHP: 7.0 7 Stable tag: 2.07 Stable tag: 3.0 8 8 License: GPL2 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset
for help on using the changeset viewer.