Skip to content

Commit ac2d856

Browse files
committed
Fix block crash in pattern creator
1 parent 8d542b4 commit ac2d856

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • public_html/wp-content/plugins/pattern-creator/src

public_html/wp-content/plugins/pattern-creator/src/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import { dispatch } from '@wordpress/data';
55
import { registerCoreBlocks } from '@wordpress/block-library';
66
import { render, unmountComponentAtNode } from '@wordpress/element';
7+
import { removeFilter } from '@wordpress/hooks';
78

89
/**
910
* Internal dependencies
@@ -45,3 +46,8 @@ export function initialize( id, settings ) {
4546
registerCoreBlocks();
4647
reinitializeEditor( target, settings );
4748
}
49+
50+
// The hook for the pattern editor somehow triggers a critical error.
51+
// The pattern editor cannot use the pattern directory in the first place,
52+
// so disables the filter itself.
53+
removeFilter( 'editor.BlockEdit', 'core/editor/with-pattern-override-controls' );

0 commit comments

Comments
 (0)