Created
December 5, 2021 13:39
-
-
Save rocket-martue/8e706c2657521b0dd08cec22747861c4 to your computer and use it in GitHub Desktop.
JavaScriptで不要なブロックを非表示にする (ブラックリスト形式)
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
wp.domReady( () => { | |
const unregisterBlocks = [ | |
'core/freeform', | |
'core/pullquote', | |
'core/verse', | |
]; | |
unregisterBlocks.forEach( blockName => { | |
wp.blocks.unregisterBlockType( blockName ); | |
} ); | |
const unregisterEmbedBlocks = [ | |
'twitter', | |
'youtube', | |
'wordpress', | |
]; | |
unregisterEmbedBlocks.forEach( blockName => { | |
wp.blocks.unregisterBlockVariation( 'core/embed', blockName ); | |
} ); | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
埋め込みブロックは、
unregisterEmbedBlocks
の方に指定する。