diff --git a/classes/class-handler.php b/classes/class-handler.php index b6005e9..d85af19 100644 --- a/classes/class-handler.php +++ b/classes/class-handler.php @@ -331,6 +331,10 @@ private function get_default_settings() { 'imgur', ], ], + 'unregisterFormatType' => [ + 'core/text-color', + 'core/image', + ], 'editorType' => $this->get_editor_type(), 'allowUrlEmbed' => false, 'pastePlainText' => false, diff --git a/src/index.tsx b/src/index.tsx index ae1c89f..204db61 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -39,9 +39,8 @@ domReady( () => { // Modify any blocks we need to addFilter( 'blocks.registerBlockType', 'blocks-everywhere/modify-blocks', customBlocks ); - // Remove some formatting options - unregisterFormatType( 'core/text-color' ); - unregisterFormatType( 'core/image' ); + // Remove any formatting options we need to disable + wpBlocksEverywhere?.unregisterFormatType.forEach( ( formatType ) => unregisterFormatType( formatType ) ); if ( wpBlocksEverywhere.editorType === 'bbpress' && wpBlocksEverywhere.autocompleter ) { addFilter(