Пример #1
0
function save_foxyshop_setup()
{
    $foxyshop_settings_update_key = isset($_POST['action']) ? $_POST['action'] : "";
    if ($foxyshop_settings_update_key != "foxyshop_setup_save") {
        return;
    }
    if (!check_admin_referer('save-foxyshop-setup')) {
        return;
    }
    global $foxyshop_settings;
    $domain = $_POST['foxyshop_domain'];
    if ($domain) {
        delete_option("foxyshop_setup_required");
    }
    //Delete the setup prompt if domain entered
    if ($domain && strpos($domain, ".") === false) {
        $domain .= ".foxycart.com";
    }
    $foxyshop_settings["domain"] = trim(stripslashes(str_replace("http://", "", $domain)));
    $foxyshop_settings['version'] = $_POST['foxyshop_version'];
    //Get Category List if >= 0.7.2
    if ($cached_shipping_categories = foxyshop_get_category_list()) {
        $foxyshop_settings['ship_categories'] = $cached_shipping_categories;
    }
    update_option("foxyshop_settings", $foxyshop_settings);
    delete_option("foxyshop_setup_required");
    wp_redirect('edit.php?post_type=foxyshop_product&page=foxyshop_settings_page&setup=1');
    die;
}
Пример #2
0
function foxyshop_ajax_get_category_list_select()
{
    check_ajax_referer('foxyshop-ajax-get-downloadable-list', 'security');
    echo foxyshop_get_category_list('select');
    die;
}