File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 3131/** WordPress Styles Class */
3232require ABSPATH . WPINC . '/class.wp-styles.php ' ;
3333
34- /** WordPress Styles Functions */
34+ /** WordPress Styles Function */
3535require ABSPATH . WPINC . '/functions.wp-styles.php ' ;
3636
3737/**
@@ -396,6 +396,16 @@ function wp_default_packages_inline_scripts( $scripts ) {
396396 'window.wp.oldEditor = window.wp.editor; ' ,
397397 'after '
398398 );
399+
400+ // wp-editor module is exposed as window.wp.editor
401+ // Problem: there is quite some code expecting window.wp.oldEditor object available under window.wp.editor
402+ // Solution: fuse the two objects together to maintain backward compatibility
403+ // For more context, see https://github.com/WordPress/gutenberg/issues/33203
404+ $ scripts ->add_inline_script (
405+ 'wp-editor ' ,
406+ 'Object.assign(window.wp.editor, window.wp.oldEditor); ' ,
407+ 'after '
408+ );
399409}
400410
401411/**
You can’t perform that action at this time.
0 commit comments