Changeset 3743287
- Timestamp:
- 10/13/2026 08:42:06 AM (2 weeks ago)
- Location:
- classic-editor-addon
- Files:
-
- 4 added
- 2 edited
-
tags/4.4.3 (added)
-
tags/4.4.3/LICENSE (added)
-
tags/4.4.3/classic-editor-addon.php (added)
-
tags/4.4.3/readme.txt (added)
-
trunk/classic-editor-addon.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
classic-editor-addon/trunk/classic-editor-addon.php
r3649292 r3743287 5 5 6 6 * Author: <a href="https://so-wp.com">Pieter Bos</a>, <a href="https://gschoppe.com">Greg Schoppe</a> 7 * Version: 4.4. 27 * Version: 4.4.3 8 8 9 9 * Requires at least: 5.5 … … 163 163 } 164 164 } 165 166 // Strip script handles from block types so WP_Block::render() cannot enqueue them at render time. 167 add_filter( 'block_type_metadata_settings', 'cea_strip_block_type_scripts', 10, 2 ); 168 function cea_strip_block_type_scripts( $settings, $metadata ) { 169 if ( ! is_admin() ) { 170 $settings['script_handles'] = array(); 171 $settings['view_script_handles'] = array(); 172 $settings['view_script_module_ids'] = array(); 173 $settings['style_handles'] = array(); 174 $settings['view_style_handles'] = array(); 175 } 176 return $settings; 177 } 178 179 // Strip block assets from all registered block types on the front end. 180 add_action( 'wp_loaded', 'cea_strip_registered_block_scripts', 100 ); 181 function cea_strip_registered_block_scripts() { 182 if ( is_admin() ) { 183 return; 184 } 185 186 $registry = WP_Block_Type_Registry::get_instance(); 187 foreach ( $registry->get_all_registered() as $block_type ) { 188 $block_type->script_handles = array(); 189 $block_type->view_script_handles = array(); 190 $block_type->view_script_module_ids = array(); 191 $block_type->style_handles = array(); 192 $block_type->view_style_handles = array(); 193 } 194 } 195 196 // Dequeue and deregister common core block scripts if enqueued directly. 197 add_action( 'wp_enqueue_scripts', 'cea_remove_block_scripts', 100 ); 198 function cea_remove_block_scripts() { 199 wp_dequeue_script( 'wp-block-library' ); 200 wp_deregister_script( 'wp-block-library' ); 201 202 // If script module API is available, dequeue any queued modules 203 if ( function_exists( 'wp_script_modules' ) && method_exists( wp_script_modules(), 'get_queue' ) ) { 204 $queue = wp_script_modules()->get_queue(); 205 if ( is_array( $queue ) && function_exists( 'wp_dequeue_script_module' ) ) { 206 foreach ( $queue as $module_id ) { 207 wp_dequeue_script_module( $module_id ); 208 } 209 } 210 } 211 } 212 213 // Safety net for global styles, which can also be enqueued late. 214 remove_action( 'wp_footer', 'wp_enqueue_global_styles', 1 ); 215 add_action( 'wp_footer', 'cea_dequeue_late_global_styles', 2 ); 216 function cea_dequeue_late_global_styles() { 217 wp_dequeue_style( 'global-styles' ); 218 wp_deregister_style( 'global-styles' ); 219 } -
classic-editor-addon/trunk/readme.txt
r3649292 r3743287 5 5 Requires PHP: 5.6 6 6 Tested up to: 7.1 7 Stable tag: 4.4. 27 Stable tag: 4.4.3 8 8 License: GPL-3.0+ 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.txt … … 18 18 19 19 <strong>What's New:</strong> 20 Removes WP Patterns 20 Several fixes that remove scripts/styles from frontend 21 21 22 22 This plugin simply disables the WP Block Editor, removes any and all styling from both front- and backend and disables the block editor for widgets too. … … 56 56 57 57 == Changelog == 58 59 = 4.4.3 = 60 61 * date: October 13, 2026 62 * Fix: block editor scripts and script modules are now removed on the front end 63 * Fix: block styles enqueued at render time (wp-block-*-inline-css) are now removed on the front end 64 * Fix: late loaded global-styles-inline-css is now removed on the front end 58 65 59 66 = 4.4.2 =
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)