Last active
January 20, 2023 18:17
-
-
Save bfintal/b2009ea7b2ed7bc5613585ad6eda0347 to your computer and use it in GitHub Desktop.
How to Run Code When the Block Editor Initializes (Gutenberg) https://benjaminintal.com/2020/01/26/how-to-run-code-when-the-block-editor-initializes-gutenberg/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import domReady from '@wordpress/dom-ready' | |
domReady( () => { | |
if ( window._wpLoadBlockEditor ) { | |
window._wpLoadBlockEditor.then( function() { | |
// Do whatever when the block editor is initialized. | |
} ) | |
} | |
} ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment