Skip to content

Commit

Permalink
Adds upgrade routine
Browse files Browse the repository at this point in the history
  • Loading branch information
nateconley committed Jun 12, 2024
1 parent 21b8b42 commit e170584
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions mailchimp_upgrade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php
/**
* Upgrade routines.
*
* @package Mailchimp
*/

/**
* Check plugin version.
*
* @since 1.6.0
* @return void
*/
function mailchimp_version_check() {
$db_option = get_option( 'mc_version' );

if ( MCSF_VER === $db_option ) {
return;
}

if ( false === $db_option || version_compare( '1.6.0', $db_option, '>' ) ) {
mailchimp_update_1_6_0();
}

update_option( 'mc_version', MCSF_VER );
}

add_action( 'plugins_loaded', 'mailchimp_version_check' );

/**
* Version 1.6.0 update routine
* - Remove MonkeyRewards checkbox option
*
* @return void
*/
function mailchimp_update_1_6_0() {
delete_option( 'mc_rewards' );
}

0 comments on commit e170584

Please sign in to comment.