Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
10 changes: 9 additions & 1 deletion inc/migration/class-colormag-migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ) ) {
Expand Down