Skip to content

Commit ce60c30

Browse files
authored
Merge pull request #190 from BeAPI/feature/blacklist-blocks
feat(Editor): add core block to default black list
2 parents d6b1d73 + 1dae58b commit ce60c30

1 file changed

Lines changed: 75 additions & 1 deletion

File tree

‎inc/Services/Editor.php‎

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,81 @@ public function gutenberg_blocks_allowed( $allowed_blocks, \WP_Block_Editor_Cont
338338
}
339339

340340
// List of disallowed blocks.
341-
$disallowed_blocks = [];
341+
$disallowed_blocks = [
342+
// Code & raw content.
343+
'core/html',
344+
'core/freeform',
345+
'core/code',
346+
'core/preformatted',
347+
'core/verse',
348+
'core/footnotes',
349+
'core/shortcode',
350+
'core/math',
351+
// Layout & media (unused).
352+
'core/text-columns',
353+
'core/nextpage',
354+
'core/read-more',
355+
// Embeds & widgets.
356+
'core/embed',
357+
'core/legacy-widget',
358+
'core/widget-group',
359+
// Accordion.
360+
'core/accordion',
361+
'core/accordion-heading',
362+
'core/accordion-item',
363+
'core/accordion-panel',
364+
'core/icon',
365+
// Theme & site (unused).
366+
'core/archives',
367+
'core/calendar',
368+
'core/categories',
369+
'core/latest-comments',
370+
'core/latest-posts',
371+
'core/rss',
372+
'core/search',
373+
'core/tag-cloud',
374+
'core/site-tagline',
375+
'core/site-title',
376+
'core/breadcrumbs',
377+
'core/navigation-overlay-close',
378+
// Post meta & author (unused).
379+
'core/post-author',
380+
'core/post-author-biography',
381+
'core/post-author-name',
382+
'core/post-navigation-link',
383+
'core/post-terms',
384+
'core/post-time-to-read',
385+
'core/avatar',
386+
// Comments (unused).
387+
'core/comments',
388+
'core/comments-pagination',
389+
'core/comments-pagination-next',
390+
'core/comments-pagination-numbers',
391+
'core/comments-pagination-previous',
392+
'core/comments-title',
393+
'core/comment-author-name',
394+
'core/comment-content',
395+
'core/comment-date',
396+
'core/comment-edit-link',
397+
'core/comment-reply-link',
398+
'core/comment-template',
399+
'core/post-comments',
400+
'core/post-comments-count',
401+
'core/post-comments-form',
402+
'core/post-comments-link',
403+
'core/post-template',
404+
// Terms (unused).
405+
'core/term-count',
406+
'core/term-description',
407+
// Lists & navigation (unused).
408+
'core/page-list',
409+
'core/page-list-item',
410+
// Reusable & misc.
411+
'core/loginout',
412+
'core/more',
413+
'core/social-link',
414+
'core/social-links',
415+
];
342416

343417
// Remove disallowed blocks from allowed blocks.
344418
foreach ( $disallowed_blocks as $block ) {

0 commit comments

Comments
 (0)