$product_id) { if (!empty($product_id) && isset($product_spins[$key])) { $spin_products[$product_id] = intval($product_spins[$key]); } } } update_option('wheel_spin_products', $spin_products); // Dnevni spin - shrani izbrano kolo $daily_spin_wheel_id = isset($_POST['wof_daily_spin_wheel_id']) ? intval($_POST['wof_daily_spin_wheel_id']) : ''; update_option('wof_daily_spin_wheel_id', $daily_spin_wheel_id); // Prikaži sporočilo o uspehu add_settings_error('wheel_settings', 'settings_updated', __('Nastavitve so bile uspešno shranjene.', 'wheel-of-fortune'), 'updated'); } // Ročno dodajanje spinov uporabniku se zdaj izvaja preko AJAX // Pridobi trenutne nastavitve $cooldown_minutes = get_option('wheel_cooldown_minutes', 0); $max_spins = get_option('wheel_max_spins', 0); $send_emails = get_option('wheel_send_emails', false); $spin_products = get_option('wheel_spin_products', array()); // Pridobi vsa kolesa za dropdown $wheels_table = $wpdb->prefix . 'wof_wheels'; $wheels = $wpdb->get_results("SELECT * FROM $wheels_table ORDER BY id ASC", ARRAY_A); $daily_spin_wheel_id = get_option('wof_daily_spin_wheel_id', ''); // Prikaži sporočila o napakah/uspehu settings_errors('wheel_settings'); ?>