Skip to content

Instantly share code, notes, and snippets.

@wplit
Last active February 15, 2019 03:19
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 wplit/d532b385d4428565148472808144450d to your computer and use it in GitHub Desktop.
Save wplit/d532b385d4428565148472808144450d to your computer and use it in GitHub Desktop.
Remove default Gutenberg blocks from editor (because simplicity)
<?php
add_filter( 'allowed_block_types', 'lit_allow_these_block_types' );
function lit_allow_these_block_types( $allowed_blocks ) {
// Below is the array of blocks that ARE allowed, so comment out to remove from the editor.
return array(
'core/image',
'core/paragraph',
'core/heading',
'core/list',
'core/gallery',
'core/list',
'core/quote',
'core/audio',
'core/cover',
//'core/file',
//'core/video',
'core/table',
//'core/verse',
//'core/code',
'core/freeform' ,
//'core/html',
//'core/preformatted',
'core/pullquote',
'core/button',
'core/text-columns',
'core/media-text',
'core/more',
//'core/nextpage',
'core/separator',
'core/spacer',
'core/shortcode',
//'core/archives',
'core/categories',
//'core/latest-comments',
//'core/latest-posts',
/* 'core/embed',
'core-embed/twitter',
'core-embed/youtube',
'core-embed/facebook',
'core-embed/instagram',
'core-embed/wordpress',
'core-embed/soundcloud',
'core-embed/spotify',
'core-embed/flickr',
'core-embed/vimeo',
'core-embed/animoto',
'core-embed/cloudup',
'core-embed/collegehumor',
'core-embed/dailymotion',
'core-embed/funnyordie',
'core-embed/hulu',
'core-embed/imgur',
'core-embed/issuu',
'core-embed/kickstarter',
'core-embed/meetup-com',
'core-embed/mixcloud',
'core-embed/photobucket',
'core-embed/polldaddy',
'core-embed/reddit',
'core-embed/reverbnation',
'core-embed/screencast',
'core-embed/scribd',
'core-embed/slideshare',
'core-embed/smugmug',
'core-embed/speaker',
'core-embed/ted',
'core-embed/tumblr',
'core-embed/videopress',
'core-embed/wordpress-tv',
'acf/your-custom-block',*/
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment