From 83b11c61c97ed1d50b40d05a0e4fc1ba8ce4abf5 Mon Sep 17 00:00:00 2001 From: Phil Johnston Date: Mon, 15 May 2023 15:34:32 -0400 Subject: [PATCH] Move addFilter back to index file --- .../js/src/blocks/pattern-block/registerPatternBlock.ts | 7 ------- wp-modules/editor/js/src/index.ts | 7 ++++++- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/wp-modules/editor/js/src/blocks/pattern-block/registerPatternBlock.ts b/wp-modules/editor/js/src/blocks/pattern-block/registerPatternBlock.ts index 1473f8fe..6e25a220 100644 --- a/wp-modules/editor/js/src/blocks/pattern-block/registerPatternBlock.ts +++ b/wp-modules/editor/js/src/blocks/pattern-block/registerPatternBlock.ts @@ -1,13 +1,6 @@ import { __ } from '@wordpress/i18n'; -import { addFilter } from '@wordpress/hooks'; import PatternEdit from './PatternEdit'; -addFilter( - 'blocks.registerBlockType', - 'pattern-manager/registerPatternBlock', - registerPatternBlock -); - export default function registerPatternBlock( settings: Record< string, unknown >, name: string diff --git a/wp-modules/editor/js/src/index.ts b/wp-modules/editor/js/src/index.ts index 7084fa2f..4361eadb 100644 --- a/wp-modules/editor/js/src/index.ts +++ b/wp-modules/editor/js/src/index.ts @@ -7,7 +7,7 @@ import PatternManagerMetaControls from './components/PatternManagerMetaControls' import changeWords from './utils/changeWords'; import preventTransform from './utils/preventTransform'; import receiveActiveTheme from './utils/receiveActiveTheme'; -import './blocks/pattern-block/registerPatternBlock'; +import registerPatternBlock from './blocks/pattern-block/registerPatternBlock'; registerPlugin( 'pattern-manager-postmeta-for-patterns', { icon: null, @@ -25,6 +25,11 @@ addFilter( 'pattern-manager/preventTransform', preventTransform ); +addFilter( + 'blocks.registerBlockType', + 'pattern-manager/registerPatternBlock', + registerPatternBlock +); addAction( 'heartbeat.tick', 'pattern-manager/checkActiveTheme',