| 1 |
<?php |
| 2 |
|
| 3 |
namespace forge12\contactform7\CF7DoubleOptIn; |
| 4 |
|
| 5 |
if ( ! defined( 'ABSPATH' ) ) { |
| 6 |
exit; |
| 7 |
} |
| 8 |
|
| 9 |
function onUpdate() { |
| 10 |
// Only run if the version installed not exist or the version is < 1.7 |
| 11 |
// this will add categories to already existing plugins |
| 12 |
if ( version_compare( get_site_option( FORGE12_OPTIN_SLUG . '_version' ), '1.7' ) < 0 ) { |
| 13 |
createTableOptinCategories(); |
| 14 |
createTableOptin(); |
| 15 |
|
| 16 |
update_option( FORGE12_OPTIN_SLUG . '_version', '1.7' ); |
| 17 |
} |
| 18 |
|
| 19 |
// Only run if the version installed not exist or the version is < 2.0 |
| 20 |
// this will add categories to already existing plugins |
| 21 |
if ( version_compare( get_site_option( FORGE12_OPTIN_SLUG . '_version' ), '2.0' ) < 0 ) { |
| 22 |
createTableOptin(); |
| 23 |
|
| 24 |
update_option( FORGE12_OPTIN_SLUG . '_version', '2.0' ); |
| 25 |
} |
| 26 |
|
| 27 |
if ( version_compare( get_site_option( FORGE12_OPTIN_SLUG . '_version' ), '3.0.1' ) < 0 ) { |
| 28 |
createTableOptin(); |
| 29 |
|
| 30 |
update_option( FORGE12_OPTIN_SLUG . '_version', '3.0.1' ); |
| 31 |
} |
| 32 |
} |
| 33 |
|
| 34 |
onUpdate(); |