From b3656e9aa2ce37bd9617f374b72898bd2957c6ad Mon Sep 17 00:00:00 2001 From: HerrVigg Date: Tue, 7 Jun 2022 00:22:42 +0200 Subject: [PATCH] Remove temporary hacks for slugs and ACF options --- admin/qtx_activation_hook.php | 9 ++++----- admin/qtx_admin_options_update.php | 10 ---------- modules/acf/src/plugin.php | 4 ---- 3 files changed, 4 insertions(+), 19 deletions(-) diff --git a/admin/qtx_activation_hook.php b/admin/qtx_activation_hook.php index c404bba3..2a228791 100644 --- a/admin/qtx_activation_hook.php +++ b/admin/qtx_activation_hook.php @@ -935,11 +935,10 @@ function qtranxf_admin_notices_slugs_migrate() { if ( qtranxf_check_admin_notice( 'slugs-migrate' ) || ! QTX_Module_Loader::is_module_active( 'slugs' ) ) { return; } - // TODO: restore quick check before release (temporarily disabled for master dev) -// $old_value = get_option( 'qts_options' ); // Very quick check to avoid loading more code. -// if ( ! $old_value ) { -// return; -// } + $old_value = get_option( 'qts_options' ); // Very quick check to avoid loading more code. + if ( ! $old_value ) { + return; + } require_once( QTRANSLATE_DIR . '/modules/slugs/admin/slugs-migrate-qts.php' ); $msg = qtranxf_slugs_check_migrate_qts(); // More advanced checks with QTS meta. if ( empty( $msg ) ) { diff --git a/admin/qtx_admin_options_update.php b/admin/qtx_admin_options_update.php index 6a2035c0..373d93d0 100644 --- a/admin/qtx_admin_options_update.php +++ b/admin/qtx_admin_options_update.php @@ -45,17 +45,7 @@ function qtranxf_edit_config() { if ( isset( $_POST['qtranslate_reset_all'] ) && isset( $_POST['qtranslate_reset_confirm'] ) ) { $messages[] = __( 'qTranslate has been reset.', 'qtranslate' ); } elseif ( isset( $_POST['default_language'] ) ) { - // TODO: remove temporary hack - restore QTS options for master dev before migration. - // Undo import legacy options in master before new options are saved with new keys... - $qts_options = get_option( 'qts_options' ); - $new_options = get_option( QTX_OPTIONS_MODULE_SLUGS ); - // Re-create original QTS options that can be properly imported again. - if ( ! $qts_options && $new_options && count( $new_options ) > 0 && strpos( array_keys( $new_options )[0], '_qts_' ) === 0 ) { - update_option( 'qts_options', $new_options, false ); - } - qtranxf_update_settings(); - // execute actions qtranxf_executeOnUpdate(); } diff --git a/modules/acf/src/plugin.php b/modules/acf/src/plugin.php index 78e04aa7..a27f5826 100644 --- a/modules/acf/src/plugin.php +++ b/modules/acf/src/plugin.php @@ -32,10 +32,6 @@ public function __construct() { public function init() { static $plugin_loaded = false; if ( ! $plugin_loaded && $this->acf_enabled() ) { - // TODO: remove temporary import of legacy option for master, rely on plugin activation in next release. - require_once( QTRANSLATE_DIR . '/admin/qtx_admin_options.php' ); - qtranxf_import_legacy_option( 'acf_qtranslate', QTX_OPTIONS_MODULE_ACF, false ); - if ( $this->acf_major_version() === 5 ) { require_once ACF_QTRANSLATE_PLUGIN_DIR . 'src/acf_5/acf.php'; $this->acf = new acf_qtranslate_acf_5( $this );