|
@@ -1,21 +1,12 @@
|
|
|
wp.domReady(() => {
|
|
|
- if (!wp.blocks) {
|
|
|
- console.error('WordPress Blocks API not available');
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- const embedBlockTypes = [
|
|
|
- 'scribd', 'amazon-kindle', 'animoto', 'bluesky', 'cloudup',
|
|
|
- 'collegehumor', 'crowdsignal', 'dailymotion', 'facebook',
|
|
|
- 'flickr', 'imgur', 'instagram', 'issuu', 'kickstarter',
|
|
|
- 'meetup-com', 'mixcloud', 'pinterest', 'pocket-casts',
|
|
|
- 'reddit', 'reverbnation', 'screencast', 'slideshare',
|
|
|
- 'smugmug', 'soundcloud', 'speaker-deck', 'spotify', 'ted',
|
|
|
- 'tiktok', 'tumblr', 'twitter', 'videopress', 'vimeo',
|
|
|
- 'wolfram-cloud', 'wordpress', 'wordpress-tv', 'youtube'
|
|
|
- ].map(type => `core/embed/${type}`);
|
|
|
-
|
|
|
- const coreBlockTypes = [
|
|
|
+ const removeBlocks = [
|
|
|
+ // Remove specific embeds
|
|
|
+ 'core/embed-facebook',
|
|
|
+ 'core/embed-instagram',
|
|
|
+ 'core/embed-scribd',
|
|
|
+ 'core/embed-tiktok',
|
|
|
+ 'core/embed-twitter',
|
|
|
+ // Remove some core blocks
|
|
|
'core/verse',
|
|
|
'core/freeform',
|
|
|
'core/archives',
|
|
@@ -26,14 +17,14 @@ wp.domReady(() => {
|
|
|
'core/social-links'
|
|
|
];
|
|
|
|
|
|
- [...embedBlockTypes, ...coreBlockTypes].forEach(blockName => {
|
|
|
+ removeBlocks.forEach(blockName => {
|
|
|
try {
|
|
|
if (wp.blocks.getBlockType(blockName)) {
|
|
|
wp.blocks.unregisterBlockType(blockName);
|
|
|
- console.log(`Unregistered block: ${blockName}`);
|
|
|
+ console.log(`Successfully removed block: ${blockName}`);
|
|
|
}
|
|
|
} catch (error) {
|
|
|
- console.warn(`Failed to unregister ${blockName}:`, error);
|
|
|
+ console.warn(`Failed to remove block ${blockName}:`, error);
|
|
|
}
|
|
|
});
|
|
|
});
|