Last active
August 21, 2021 04:55
-
-
Save bagerathan/cdd9dc22e715cee3d2c786f9188010b7 to your computer and use it in GitHub Desktop.
[remove core blocks] #wp #gutenburg
This file contains hidden or 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
add_filter( 'allowed_block_types', 'misha_allowed_block_types', 10, 2 ); | |
function misha_allowed_block_types( $allowed_blocks, $post ) { | |
$allowed_blocks = array( | |
'core/image', | |
'core/paragraph', | |
'core/heading', | |
'core/list' | |
); | |
if( $post->post_type === 'page' ) { | |
$allowed_blocks[] = 'core/shortcode'; | |
} | |
return $allowed_blocks; | |
} | |
//available blocks. | |
core/paragraph | |
core/image | |
core/heading | |
(Deprecated) core/subhead — Subheading | |
core/gallery | |
core/list | |
core/quote | |
core/audio | |
core/cover (previously core/cover-image) | |
core/file | |
core/video | |
core/table | |
core/verse | |
core/code | |
core/freeform — Classic | |
core/html — Custom HTML | |
core/preformatted | |
core/pullquote | |
core/buttons | |
core/text-columns — Columns | |
core/media-text — Media and Text | |
core/more | |
core/nextpage — Page break | |
core/separator | |
core/spacer | |
core/shortcode | |
core/archives | |
core/categories | |
core/latest-comments | |
core/latest-posts | |
core/calendar | |
core/rss | |
core/search | |
core/tag-cloud | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment