Skip to content

Instantly share code, notes, and snippets.

@VelichkoAlexander
Created August 8, 2022 07:48
Show Gist options
  • Save VelichkoAlexander/8a4e2ed492a584a30cd3089491e20cb4 to your computer and use it in GitHub Desktop.
Save VelichkoAlexander/8a4e2ed492a584a30cd3089491e20cb4 to your computer and use it in GitHub Desktop.
//To fetch the list of all registered blocks in the JS, we can do something like this:
wp.blocks.getBlockTypes()
//Also, to get a list of blocks for a particular namespace, you may use something like this:
wp.blocks.getBlockTypes().filter((block) => { return block.name.indexOf(NAMESPACE) !== -1});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment