Skip to content

Instantly share code, notes, and snippets.

@clarklab
Created January 28, 2020 19:05
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 clarklab/9ed1c138461c6871fe29d9990e8eb8f7 to your computer and use it in GitHub Desktop.
Save clarklab/9ed1c138461c6871fe29d9990e8eb8f7 to your computer and use it in GitHub Desktop.
WordPress whitelist Gutenberg blocks
<?php
/**
* Block whitelist
* Only allow certain blocks to be used
*/
add_filter( 'allowed_block_types', 'our_allowed_block_types' );
function our_allowed_block_types( $allowed_blocks ) {
return array(
'core/image',
'core/paragraph',
'core/heading',
'core/list',
'core/media-text',
'core/quote',
'core/group',
'core/button',
'acf/hero',
'acf/utility',
'acf/testimonials'
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment