From cecb441cbb700cd9bb936c940cf6568635d529c5 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Thu, 18 Apr 2024 04:49:12 +0000 Subject: [PATCH] Support Forums: Remove additional format options that are not needed in the support Forums. See https://github.com/Automattic/blocks-everywhere/pull/204. See #7599. git-svn-id: https://meta.svn.wordpress.org/sites/trunk@13561 74240141-8908-4e6f-9713-ba540dce6ec7 --- .../support-forums/inc/class-blocks.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-blocks.php b/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-blocks.php index d7891336d6..52c8df57c0 100644 --- a/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-blocks.php +++ b/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-blocks.php @@ -79,11 +79,21 @@ public function editor_settings( $settings ) { // Allows embeds and might fix pasting links sometimes not working. $settings['iso']['blocks']['allowBlocks'][] = 'core/embed'; - // Adds a table of contents button in the toolbar. - $settings['toolbar']['toc'] = true; - // Adds a navigation button in the toolbar. - $settings['toolbar']['navigation'] = true; + $settings['toolbar']['navigation'] = false; + + // We don't need these on the forums. + $settings['unregisterFormatType'][] = 'core/keyboard'; + $settings['unregisterFormatType'][] = 'core/language'; + $settings['unregisterFormatType'][] = 'core/non-breaking-space'; + $settings['unregisterFormatType'][] = 'core/subscript'; + $settings['unregisterFormatType'][] = 'core/superscript'; + $settings['unregisterFormatType'][] = 'core/strikethrough'; + $settings['unregisterFormatType'][] = 'core/underline'; + + // WP Calypso editor adds some too. + $settings['unregisterFormatType'][] = 'wpcom/justify'; + $settings['unregisterFormatType'][] = 'wpcom/underline'; // This will display a support link in an ellipsis menu in the top right of the editor. $settings['iso']['moreMenu'] = true;