示例#1
0
            /*
             * There are non-compatible add-ons installed.
             */
            return FALSE;
        }
    }
    return $has_addons;
}
/*
|--------------------------------------------------------------------------
| Uninstall Hook
|--------------------------------------------------------------------------
*/
if (nf_is_freemius_on()) {
    // Override plugin's version, should be executed before Freemius init.
    nf_override_plugin_version();
    // Init Freemius.
    nf_fs();
    nf_fs()->add_action('after_uninstall', 'ninja_forms_uninstall');
} else {
    register_uninstall_hook(__FILE__, 'ninja_forms_uninstall');
}
function ninja_forms_uninstall()
{
    global $wpdb;
    $settings = Ninja_Forms()->get_plugin_settings();
    // Bail if we haven't checked the "delete on uninstall" box.
    if (isset($settings['delete_on_uninstall']) && 1 == $settings['delete_on_uninstall']) {
        // Remove our options.
        delete_option('ninja_forms_settings');
        delete_option('nf_version_upgraded_from');
function nf_fs_upgrade()
{
    update_option('ninja_forms_version', '3.0');
    nf_override_plugin_version();
    if (!nf_fs()->is_registered() && nf_fs()->has_api_connectivity()) {
        if (nf_fs()->opt_in()) {
            // Successful opt-in into Freemius.
            // Turn Freemius on.
            update_option('ninja_forms_freemius', 1);
        }
    } else {
        if (nf_fs()->is_registered()) {
            // Send immediate re-upgrade event.
            nf_fs()->_run_sync_install();
        }
    }
}