PluginProbe
Block Animations, Motion & Scroll Effects – Ghost Kit / 3.3.2
Block Animations, Motion & Scroll Effects – Ghost Kit v3.3.2
3.7.2 3.7.1 3.7.0 3.6.1 trunk 1.6.3 2.25.0 3.3.0 3.3.1 3.3.2 3.3.3 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6 3.5.0 3.5.1 3.6.0
ghostkit / gutenberg / disable-blocks / index.js

index.js in Block Animations, Motion & Scroll Effects – Ghost Kit 3.3.2, at gutenberg/disable-blocks/index.js

33 lines 761 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import $ from 'jquery';
2
3 import { unregisterBlockType } from '@wordpress/blocks';
4 const {
5 GHOSTKIT,
6 _wpLoadBlockEditor: wpLoadBlockEditor,
7 _wpLoadGutenbergEditor: wpLoadGutenbergEditor,
8 } = window;
9
10 let loadBlocksEditor = null;
11
12 if (typeof wpLoadBlockEditor !== 'undefined') {
13 // Using Gutenberg plugin
14 loadBlocksEditor = wpLoadBlockEditor;
15 } else if (typeof wpLoadGutenbergEditor !== 'undefined') {
16 // Using WP core Gutenberg
17 loadBlocksEditor = wpLoadGutenbergEditor;
18 }
19
20 $(() => {
21 if (loadBlocksEditor && GHOSTKIT) {
22 loadBlocksEditor.then(() => {
23 if (GHOSTKIT.disabledBlocks) {
24 Object.keys(GHOSTKIT.disabledBlocks).forEach((name) => {
25 if (GHOSTKIT.disabledBlocks[name]) {
26 unregisterBlockType(name);
27 }
28 });
29 }
30 });
31 }
32 });
33