Created
June 23, 2023 19:28
-
-
Save igorbenic/2ef40ebaa843f1dcde15fb43d2cba267 to your computer and use it in GitHub Desktop.
Programmatically Add a Block to WordPress | ibenic.com
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
var block = wp.blocks.createBlock('core/paragraph', {content: 'From Console'}); | |
wp.data.dispatch('core/block-editor').insertBlocks(block); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment