Created
January 28, 2020 19:05
-
-
Save clarklab/9ed1c138461c6871fe29d9990e8eb8f7 to your computer and use it in GitHub Desktop.
WordPress whitelist Gutenberg blocks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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