Skip to content

Commit 3e0756b

Browse files
author
Ashley Stanley
committed
Re-add embed blocks
1 parent c6db2ea commit 3e0756b

File tree

2 files changed

+1
-21
lines changed

2 files changed

+1
-21
lines changed

assets/js/block-filters/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
*/
66

77
// Import the block filter file.
8-
import './unregister-core-embed';
8+
import './unregister-core-blocks';
99
import './buttons';

assets/js/block-filters/unregister-core-embed.js renamed to assets/js/block-filters/unregister-core-blocks.js

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,6 @@ document.addEventListener('DOMContentLoaded', function () {
2424
// },
2525
];
2626

27-
// Keep only the necessary embed variations.
28-
const embedBlockVariations = wp.blocks.getBlockVariations('core/embed');
29-
const keepEmbeds = [
30-
'twitter',
31-
'wordpress',
32-
'spotify',
33-
'soundcloud',
34-
'flickr',
35-
];
36-
3727
// Unregister unused blocks.
3828
unusedBlocks.forEach((block) => {
3929
wp.blocks.unregisterBlockType(block);
@@ -46,16 +36,6 @@ document.addEventListener('DOMContentLoaded', function () {
4636
variation.blockVariationName
4737
);
4838
});
49-
50-
// Keep only necessary embed variations.
51-
embedBlockVariations.forEach((variation) => {
52-
if (!keepEmbeds.includes(variation.name)) {
53-
wp.blocks.unregisterBlockVariation(
54-
'core/embed',
55-
variation.name
56-
);
57-
}
58-
});
5939
} else {
6040
// eslint-disable-next-line no-console
6141
console.error('wp.blocks object is not available.');

0 commit comments

Comments
 (0)