# ghostkit/3.3.2/gutenberg/disable-blocks/index.js

Block Animations, Motion &amp; Scroll Effects – Ghost Kit, version 3.3.2. 33 lines.

- Page: https://pluginprobe.com/plugins/ghostkit/3.3.2/code/gutenberg/disable-blocks/index.js
- Raw: https://pluginprobe.com/plugins/ghostkit/3.3.2/raw/gutenberg/disable-blocks/index.js
- Modified: 2024-02-18T18:40:24+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/ghostkit/3.3.2/code/gutenberg/disable-blocks/index.js#L10-L20`.

```javascript
import $ from 'jquery';

import { unregisterBlockType } from '@wordpress/blocks';
const {
	GHOSTKIT,
	_wpLoadBlockEditor: wpLoadBlockEditor,
	_wpLoadGutenbergEditor: wpLoadGutenbergEditor,
} = window;

let loadBlocksEditor = null;

if (typeof wpLoadBlockEditor !== 'undefined') {
	// Using Gutenberg plugin
	loadBlocksEditor = wpLoadBlockEditor;
} else if (typeof wpLoadGutenbergEditor !== 'undefined') {
	// Using WP core Gutenberg
	loadBlocksEditor = wpLoadGutenbergEditor;
}

$(() => {
	if (loadBlocksEditor && GHOSTKIT) {
		loadBlocksEditor.then(() => {
			if (GHOSTKIT.disabledBlocks) {
				Object.keys(GHOSTKIT.disabledBlocks).forEach((name) => {
					if (GHOSTKIT.disabledBlocks[name]) {
						unregisterBlockType(name);
					}
				});
			}
		});
	}
});

```
