Skip to content

Commit

Permalink
Remove temporary hacks for slugs and ACF options
Browse files Browse the repository at this point in the history
  • Loading branch information
herrvigg committed Jun 6, 2022
1 parent 9fea88a commit b3656e9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 19 deletions.
9 changes: 4 additions & 5 deletions admin/qtx_activation_hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) ) {
Expand Down
10 changes: 0 additions & 10 deletions admin/qtx_admin_options_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
4 changes: 0 additions & 4 deletions modules/acf/src/plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit b3656e9

Please sign in to comment.