Skip to content

Instantly share code, notes, and snippets.

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 richardtape/76182be19244f0b7bccfae15aef05a14 to your computer and use it in GitHub Desktop.
Save richardtape/76182be19244f0b7bccfae15aef05a14 to your computer and use it in GitHub Desktop.
// See richardtape.com/?p=348
/**
* Is the passed block name one which supports our custom field?
*
* @param {string} name The name of the block.
*/
function isValidBlockType( name ) {
const validBlockTypes = [
'core/paragraph',
'core/image',
'core/heading',
];
return validBlockTypes.includes( name );
}// end isValidBlockType()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment