コード例 #1
0
function form_maker_activate_cfm()
{
    $version = get_option("wd_form_maker_version");
    $new_version = '1.7.33';
    if (!$version) {
        add_option("wd_form_maker_version", $new_version, '', 'no');
        global $wpdb;
        if ($wpdb->get_var("SHOW TABLES LIKE '" . $wpdb->prefix . "formmaker'") == $wpdb->prefix . "formmaker") {
            require_once WD_FMC_DIR . "/contact_form_maker_update.php";
            contact_form_maker_update_until_mvc();
            contact_form_maker_update('');
        } else {
            require_once WD_FMC_DIR . "/contact_form_maker_insert.php";
            contact_from_maker_insert();
        }
    } elseif (version_compare($version, $new_version, '<')) {
        require_once WD_FMC_DIR . "/contact_form_maker_update.php";
        contact_form_maker_update($version);
        update_option("wd_form_maker_version", $new_version);
    }
    require_once WD_FMC_DIR . "/contact_form_maker_insert.php";
    install_demo_forms_fmc();
}
コード例 #2
0
function contact_form_maker_activate()
{
    $version = get_option("wd_contact_form_maker_version");
    $new_version = '1.0.31';
    if ($version && version_compare($version, $new_version, '<')) {
        require_once WD_CFM_DIR . "/contact-form-builder-update.php";
        contact_form_maker_update($version);
        update_option("wd_contact_form_maker_version", $new_version);
    } else {
        require_once WD_CFM_DIR . "/contact-form-builder-insert.php";
        contact_form_maker_insert();
        add_option("wd_contact_form_maker_version", $new_version, '', 'no');
    }
}