From d0e5470bc9020ed9a469395cda7decb98182c837 Mon Sep 17 00:00:00 2001 From: Jenisha Munikar Date: Mon, 13 Oct 2025 14:23:57 +0545 Subject: [PATCH] moved colormag_fresh_install function to migration class --- functions.php | 9 --------- inc/migration/class-colormag-migration.php | 10 +++++++++- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/functions.php b/functions.php index 9b843097..e04d048b 100644 --- a/functions.php +++ b/functions.php @@ -115,15 +115,6 @@ function colormag_maybe_enable_builder() { return true; } -function colormag_fresh_install() { - - if ( get_option( 'colormag_free_major_update_customizer_migration_v1' ) || get_option( 'colormag_top_bar_options_migrate' ) || get_option( 'colormag_breadcrumb_options_migrate' ) || get_option( 'colormag_social_icons_control_migrate' ) ) { - return false; - } - - return true; -} - /** * Deprecated. */ diff --git a/inc/migration/class-colormag-migration.php b/inc/migration/class-colormag-migration.php index 2621ef1d..365c78e2 100644 --- a/inc/migration/class-colormag-migration.php +++ b/inc/migration/class-colormag-migration.php @@ -36,13 +36,21 @@ public function __construct() { $theme_installed_time = get_option( 'colormag_theme_installed_time' ); // timestamp $today = strtotime( '2025-09-22' ); - if ( ! colormag_fresh_install() || ( ! empty( $theme_installed_time ) && $theme_installed_time < $today ) ) { + if ( ! $this->colormag_fresh_install() || ( ! empty( $theme_installed_time ) && $theme_installed_time < $today ) ) { add_action( 'after_setup_theme', [ $this, 'colormag_container_sidebar_migration' ] ); add_action( 'after_setup_theme', [ $this, 'colormag_typography_migration' ] ); } add_action( 'themegrill_ajax_demo_imported', [ $this, 'colormag_container_sidebar_migration' ], 25 ); } + public function colormag_fresh_install() { + if ( get_option( 'colormag_free_major_update_customizer_migration_v1' ) || get_option( 'colormag_top_bar_options_migrate' ) || get_option( 'colormag_breadcrumb_options_migrate' ) || get_option( 'colormag_social_icons_control_migrate' ) ) { + return false; + } + + return true; + } + public function colormag_typography_migration() { if ( get_option( 'colormag_typography_migration' ) ) {