Skip to content

Instantly share code, notes, and snippets.

@paulgibbs
Created October 14, 2020 08:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulgibbs/759d7788866905681a5a6ae4f22eef59 to your computer and use it in GitHub Desktop.
Save paulgibbs/759d7788866905681a5a6ae4f22eef59 to your computer and use it in GitHub Desktop.
cy
.window()
.its('wp')
.then(wp => {
wp.blocks.getBlockTypes().forEach(({ name }) => {
wp.data.dispatch('core/editor').insertBlocks( wp.blocks.createBlock(name, {}) );
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment