Skip to content

Commit b098c00

Browse files
Add limited amount of core blocks for articles by default, remove extra embed blocks, T-25121
1 parent 7159a35 commit b098c00

File tree

5 files changed

+60
-5
lines changed

5 files changed

+60
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
### [Unreleased]
1+
### 9.4.8: 2025-02-03
22

33
* Add debug function to print all available blocks
44
* Fix page including all allowed blocks by default (default: none)
55
* Fix cssnano stripping out font-family declarations
66
* Remove root font-size 62.5% from editor styles, T-24605
7+
* Add limited amount of core blocks for articles by default, remove extra embed blocks, T-25121
78

89
### 9.4.7: 2024-12-04
910

functions.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,25 @@
140140
// or any specific block or a combination of these
141141
// Accepts both string (all*/none-options only) and array (options + specific blocks)
142142
'allowed_blocks' => [
143-
'post' => 'all-core-blocks',
143+
'post' => [
144+
'core/code',
145+
'core/column',
146+
'core/columns',
147+
'core/coverImage',
148+
'core/embed',
149+
'core/freeform',
150+
'core/gallery',
151+
'core/heading',
152+
'core/html',
153+
'core/image',
154+
'core/list',
155+
'core/list-item',
156+
'core/paragraph',
157+
'core/quote',
158+
'core/block',
159+
'core/table',
160+
'core/textColumns',
161+
],
144162
'page' => [],
145163
// 'page' => [
146164
// 'all-acf-blocks',

js/dev/gutenberg-editor.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/prod/gutenberg-editor.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/src/gutenberg-editor.js

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,46 @@
1+
/* eslint-disable no-undef */
12
// Declare the blocks you'd like to style.
2-
// eslint-disable-next-line
33
wp.blocks.registerBlockStyle('core/paragraph', {
44
name: 'boxed',
55
label: 'Laatikko',
66
});
77

8+
// Deregister some unused embed blocks
9+
wp.domReady(() => {
10+
wp.blocks.unregisterBlockVariation('core/embed', 'amazon-kindle');
11+
wp.blocks.unregisterBlockVariation('core/embed', 'bluesky');
12+
wp.blocks.unregisterBlockVariation('core/embed', 'pinterest');
13+
wp.blocks.unregisterBlockVariation('core/embed', 'crowdsignal');
14+
wp.blocks.unregisterBlockVariation('core/embed', 'soundcloud');
15+
wp.blocks.unregisterBlockVariation('core/embed', 'twitter');
16+
wp.blocks.unregisterBlockVariation('core/embed', 'wordpress');
17+
wp.blocks.unregisterBlockVariation('core/embed', 'spotify');
18+
wp.blocks.unregisterBlockVariation('core/embed', 'flickr');
19+
wp.blocks.unregisterBlockVariation('core/embed', 'animoto');
20+
wp.blocks.unregisterBlockVariation('core/embed', 'cloudup');
21+
wp.blocks.unregisterBlockVariation('core/embed', 'vimeo');
22+
wp.blocks.unregisterBlockVariation('core/embed', 'youtube');
23+
wp.blocks.unregisterBlockVariation('core/embed', 'dailymotion');
24+
wp.blocks.unregisterBlockVariation('core/embed', 'imgur');
25+
wp.blocks.unregisterBlockVariation('core/embed', 'issuu');
26+
wp.blocks.unregisterBlockVariation('core/embed', 'kickstarter');
27+
wp.blocks.unregisterBlockVariation('core/embed', 'mixcloud');
28+
wp.blocks.unregisterBlockVariation('core/embed', 'pocket-casts');
29+
wp.blocks.unregisterBlockVariation('core/embed', 'reddit');
30+
wp.blocks.unregisterBlockVariation('core/embed', 'reverbnation');
31+
wp.blocks.unregisterBlockVariation('core/embed', 'screencast');
32+
wp.blocks.unregisterBlockVariation('core/embed', 'scribd');
33+
wp.blocks.unregisterBlockVariation('core/embed', 'smugmug');
34+
wp.blocks.unregisterBlockVariation('core/embed', 'speaker-deck');
35+
wp.blocks.unregisterBlockVariation('core/embed', 'tumblr');
36+
wp.blocks.unregisterBlockVariation('core/embed', 'tiktok');
37+
wp.blocks.unregisterBlockVariation('core/embed', 'ted');
38+
wp.blocks.unregisterBlockVariation('core/embed', 'videopress');
39+
wp.blocks.unregisterBlockVariation('core/embed', 'wolfram-cloud');
40+
wp.blocks.unregisterBlockVariation('core/embed', 'wordpress-tv');
41+
wp.blocks.unregisterBlockVariation('core/embed', 'facebook');
42+
});
43+
844
// When document is ready as in when blocks are fully loaded
945
window.addEventListener('load', () => {
1046
/**

0 commit comments

Comments
 (0)