From 6d669c055aaaee846d436f712eb2b8d71a7433bf Mon Sep 17 00:00:00 2001 From: Keith Solomon Date: Sat, 13 Jun 2026 10:33:08 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8feature:=20Remove=20unused/replaced=20?= =?UTF-8?q?blocks,=20remove=20gravity=20forms=20styling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/hooks.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/lib/hooks.php b/lib/hooks.php index 5ce5026..d89d1a3 100644 --- a/lib/hooks.php +++ b/lib/hooks.php @@ -138,6 +138,28 @@ add_filter( } ); +/** + * Remove unused or replaced core blocks + * + * @return array List of allowed block types + */ +add_filter( + 'allowed_block_types_all', + function () { + // get all the registered blocks + $blocks = \WP_Block_Type_Registry::get_instance()->get_all_registered(); + + // then disable some of them + unset( $blocks['core/media-text'] ); + unset( $blocks['core/calendar'] ); + unset( $blocks['core/buttons'] ); + unset( $blocks['core/search'] ); + + // return the new list of allowed blocks + return array_keys( $blocks ); + } +); + /** * WP Cleanup */ @@ -241,6 +263,13 @@ add_action( } ); +/** + * Disable Gravity Forms theme CSS + */ +add_filter( 'gform_disable_css', '__return_true' ); +add_filter( 'gform_disable_form_theme_css', '__return_true' ); +add_filter( 'gform_disable_form_legacy_css', '__return_true' ); + /** * Filters the email address used as the sender in outgoing emails. *