From 6116d759ddf1d4b95a95cdd6d2dcb1f092656aa6 Mon Sep 17 00:00:00 2001 From: Marcus Kazmierczak Date: Wed, 9 Jan 2019 14:56:53 -0800 Subject: [PATCH] Update docs for unregisterBlockType --- .../developers/filters/block-filters.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/designers-developers/developers/filters/block-filters.md b/docs/designers-developers/developers/filters/block-filters.md index 4f28cf17a9f18..cc4f71bb95540 100644 --- a/docs/designers-developers/developers/filters/block-filters.md +++ b/docs/designers-developers/developers/filters/block-filters.md @@ -261,8 +261,9 @@ Adding blocks is easy enough, removing them is as easy. Plugin or theme authors ```js // my-plugin.js - -wp.blocks.unregisterBlockType( 'core/verse' ); +wp.domReady( function() { + wp.blocks.unregisterBlockType( 'core/verse' ); +} ); ``` and load this script in the Editor @@ -275,7 +276,7 @@ function my_plugin_blacklist_blocks() { wp_enqueue_script( 'my-plugin-blacklist-blocks', plugins_url( 'my-plugin.js', __FILE__ ), - array( 'wp-blocks' ) + array( 'wp-blocks', 'wp-dom-ready', 'wp-edit-post' ) ); } add_action( 'enqueue_block_editor_assets', 'my_plugin_blacklist_blocks' );