コード例 #1
0
function tinypass_upgrades()
{
    tinypass_include();
    $current = get_option('tinypass_version');
    if ($current < '2.1.0') {
        $storage = new TPStorage();
        $ss = $storage->getSiteSettings();
        //update the old wp_bundle1
        $pw = $storage->findPaywall('wp_bundle1');
        if ($pw != null) {
            $pw->setEnabled(true);
            if ($pw->getMode() == 0) {
                $pw->setEnabled(false);
            }
            $storage->savePaywallSettings($ss, $pw);
        }
        update_option('tinypass_version', '2.1.0');
    }
    if ($current < '3.0.0') {
        //mark this as legacy
        update_option('tinypass_legacy', 1);
        update_option('tinypass_version', '3.0.0');
    }
}