Last active
January 20, 2023 18:17
Star
You must be signed in to star a gist
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 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