Skip to content

Commit

Permalink
chore(block-types): Disable more blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Log1x committed Aug 21, 2022
1 parent af0755b commit 77b64c5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin Name: GutenTweaks
* Plugin URI: https://github.com/log1x/gutentweaks
* Description: A plugin containing a few Gutenberg tweaks.
* Version: 1.0.0
* Version: 1.0.3
* Author: Brandon Nifong
* Author URI: https://github.com/log1x
* Licence: MIT
Expand Down
2 changes: 1 addition & 1 deletion public/js/blocks.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('wp-blocks', 'wp-data', 'wp-dom-ready', 'wp-edit-post', 'wp-i18n', 'wp-plugins'), 'version' => '770852d63d44542f8d64f6befc1060ab');
<?php return array('dependencies' => array('wp-blocks', 'wp-data', 'wp-dom-ready', 'wp-edit-post', 'wp-i18n', 'wp-plugins'), 'version' => '914ac78be1dd26aefd77d806603363e9');
2 changes: 1 addition & 1 deletion public/js/blocks.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions resources/js/extensions/disable-block-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const blacklist = [
'core/widget-area',
'editorskit/',
'html-forms/',
'mv/',
'page-generator-pro/',
'rank-math/howto-block',
'yoast-seo/breadcrumbs',
Expand All @@ -74,8 +75,8 @@ const blacklist = [

domReady(() => {
getBlockTypes().forEach(
block =>
blacklist.some(x => block.name.includes(x)) &&
(block) =>
blacklist.some((x) => block.name.includes(x)) &&
unregisterBlockType(block.name)
)
})

0 comments on commit 77b64c5

Please sign in to comment.