From 47df99cbb310564aaeb13d4b0d3029f034829dc2 Mon Sep 17 00:00:00 2001 From: Tautvidas Sipavicius Date: Sun, 28 Nov 2021 03:50:53 +0200 Subject: [PATCH] Disable the Redux framework Gutenberg block library by default --- readme.txt | 2 +- src/WPML_LifeCycle.php | 11 +++++++++++ src/inc/redux/WPML_Redux_Framework_config.php | 11 ----------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/readme.txt b/readme.txt index d19462b0..1bc99a2c 100644 --- a/readme.txt +++ b/readme.txt @@ -120,7 +120,7 @@ Yes, directly on disableReduxFunctionality(); } /** @@ -65,6 +66,7 @@ public function upgrade() { * @return void */ public function activate() { + $this->disableReduxFunctionality(); } /** @@ -208,4 +210,13 @@ public function registerPluginActionLinks( $actions, $plugin_file ) { return $actions; } + // Disable unnecessary Redux Framework functionality + public function disableReduxFunctionality() { + // Disable the default Redux and Extendify Gutenberg block library + update_option( 'use_redux_templates', '' ); + update_option( 'use_extendify_templates', '' ); + + // Disable the Redux activation banner + update_option( 'redux-framework_tracking_notice', 'hide' ); + } } diff --git a/src/inc/redux/WPML_Redux_Framework_config.php b/src/inc/redux/WPML_Redux_Framework_config.php index cc13b554..da7a4fa0 100644 --- a/src/inc/redux/WPML_Redux_Framework_config.php +++ b/src/inc/redux/WPML_Redux_Framework_config.php @@ -73,17 +73,6 @@ public function initSettings() { if ( method_exists( "Redux", "disable_demo" ) ) { \Redux::disable_demo(); } - - // Disable the default Redux and Extendify Gutenberg block library - if ( class_exists( "Redux_Core" ) && property_exists( "Redux_Core", "redux_templates_enabled" ) ) { - \Redux_Core::$redux_templates_enabled = false; - } - if ( class_exists( "Redux_Core" ) && property_exists( "Redux_Core", "extendify_templates_enabled" ) ) { - \Redux_Core::$extendify_templates_enabled = false; - } - - // Disable the Redux activation banner - update_option( 'redux-framework_tracking_notice', 'hide' ); } // Remove the demo link and the notice of integrated demo from the redux-framework plugin