Skip to content

Instantly share code, notes, and snippets.

@psorensen
Created July 21, 2021 00:10
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 psorensen/e0015e4ffce870c63399c2a3ab5a6012 to your computer and use it in GitHub Desktop.
Save psorensen/e0015e4ffce870c63399c2a3ab5a6012 to your computer and use it in GitHub Desktop.
Get all block names of given namespace
wp.blocks.getBlockTypes().filter((block) => { return block.name.indexOf('jetpack') !== -1 }).map(o => o['name'])
// credit https://stackoverflow.com/a/37092497
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment