Skip to content

Commit

Permalink
enhance(block): Unregister FSE blocks
Browse files Browse the repository at this point in the history
enhance(block): Unregister unused Yoast blocks
chore(block): Remove category filter
  • Loading branch information
Log1x committed Aug 14, 2022
1 parent 56a1013 commit 9f70c86
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 32 deletions.
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-hooks', 'wp-i18n', 'wp-plugins'), 'version' => '5423e9ce2f9cf08a50b752e58d9e5516');
<?php return array('dependencies' => array('wp-blocks', 'wp-data', 'wp-dom-ready', 'wp-edit-post', 'wp-i18n', 'wp-plugins'), 'version' => '770852d63d44542f8d64f6befc1060ab');
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.

2 changes: 1 addition & 1 deletion public/js/editor.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array(), 'version' => 'ad98890364eac3f930bf40350a038391');
<?php return array('dependencies' => array(), 'version' => '07bbd8adab72390e65fc1d151a71c3c8');
2 changes: 1 addition & 1 deletion public/js/editor.js

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

4 changes: 0 additions & 4 deletions resources/js/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@ import './extensions/disable-block-types'
import './extensions/disable-welcome-guide'
import './extensions/disable-fullscreen'

import { filterCategories } from './extensions/filter-categories'

import {
registerBlockStyles,
unregisterBlockStyles,
} from './hooks/block-styles'

filterCategories('formatting', ['conversion', 'embed', 'widgets'])

/**
* Document Ready
* @see https://www.npmjs.com/package/@wordpress/dom-ready
Expand Down
64 changes: 53 additions & 11 deletions resources/js/extensions/disable-block-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,74 @@ import domReady from '@wordpress/dom-ready'
import { unregisterBlockType, getBlockTypes } from '@wordpress/blocks'

const blacklist = [
'core-embed/',
'editorskit/',
'page-generator-pro/',
'rank-math/howto-block',
'yoast-seo/related-links',
'yoast-seo/subpages',
'yoast-seo/siblings',
'core/audio',
'core/archive',
'core/audio',
'core/avatar',
'core/calendar',
'core/categories',
'core/comment-author-name',
'core/comment-content',
'core/comment-date',
'core/comment-edit-link',
'core/comment-reply-link',
'core/comments-pagination-next',
'core/comments-pagination-numbers',
'core/comments-pagination-previous',
'core/comments-pagination',
'core/comments-query-loop',
'core/comments-title',
'core/embed',
'core/file',
'core/gallery',
'core/latest-comments',
'core/latest-posts',
'core/legacy-widget',
'core/widget-area',
'core/embed',
'core/loginout',
'core/more',
'core/navigation',
'core/nextpage',
'core/page-list',
'core/post-author-biography',
'core/post-author',
'core/post-comments-form',
'core/post-comments',
'core/post-content',
'core/post-date',
'core/post-excerpt',
'core/post-featured-image',
'core/post-navigation-link',
'core/post-template',
'core/post-terms',
'core/post-title',
'core/query-no-results',
'core/query-pagination-next',
'core/query-pagination-numbers',
'core/query-pagination-previous',
'core/query-pagination',
'core/query-title',
'core/query',
'core/read-more',
'core/rss',
'core/search',
'core/site-logo',
'core/site-tagline',
'core/site-title',
'core/social-link',
'core/tag-cloud',
'core/template-part',
'core/term-description',
'core/verse',
'core/navigation',
'core/widget-area',
'editorskit/',
'html-forms/',
'page-generator-pro/',
'rank-math/howto-block',
'yoast-seo/breadcrumbs',
'yoast-seo/estimated-reading-time',
'yoast-seo/related-links',
'yoast-seo/siblings',
'yoast-seo/subpages',
'yoast-seo/table-of-contents',
]

domReady(() => {
Expand Down
13 changes: 0 additions & 13 deletions resources/js/extensions/filter-categories.js

This file was deleted.

0 comments on commit 9f70c86

Please sign in to comment.