Ups! Diese Seite konnte leider nicht gefunden werden.
Wie es aussieht, wurde an dieser Stelle nichts gefunden. Möchtest Du danach suchen?
add_settings_field('excerpt_length', __('Max. Länge Auszug', 'buchhalde-events'), function () use ($option_name) { $opts = get_option($option_name, []); $val = (int)($opts['excerpt_length'] ?? 160); echo ''; }, 'buchhalde-events', 'be_default'); add_settings_field('card_gap', __('Abstand zwischen Cards (px)', 'buchhalde-events'), function () use ($option_name) { $opts = get_option($option_name, []); $val = isset($opts['card_gap']) ? (int)$opts['card_gap'] : 0; echo ''; }, 'buchhalde-events', 'be_default'); add_settings_field('card_padding', __('Innenabstand in Card (px)', 'buchhalde-events'), function () use ($option_name) { $opts = get_option($option_name, []); $val = isset($opts['card_padding']) ? (int)$opts['card_padding'] : 3; echo ''; }, 'buchhalde-events', 'be_default'); add_settings_field('action_separator', __('Trennzeichen Aktionen', 'buchhalde-events'), function () use ($option_name) { $opts = get_option($option_name, []); $val = $opts['action_separator'] ?? ' · '; echo ''; }, 'buchhalde-events', 'be_default'); add_settings_field('button_style', __('Stil „Jetzt buchen“', 'buchhalde-events'), function () use ($option_name) { $opts = get_option($option_name, []); $val = $opts['button_style'] ?? 'button'; echo ''; }, 'buchhalde-events', 'be_default'); } /** * Sanitize/normalisieren der Optionen. Sorgt dafür, dass Checkboxen (0/1) korrekt * gespeichert werden, fehlende Keys Defaults erhalten und Zahlenwerte validiert werden. */ public static function sanitize($input) { $input = is_array($input) ? $input : []; // Lade bestehende Optionen, damit nicht übermittelte Felder (z. B. unchecked Checkboxes) // nicht versehentlich verschwinden – wir setzen sie explizit auf 0 weiter unten. $existing = get_option('buchhalde_events_options', []); $out = is_array($existing) ? $existing : []; // Helper $bool = function($key) use (&$input) { return isset($input[$key]) && (string)$input[$key] === '1' ? 1 : 0; }; $intval = function($key, $min, $max, $default) use (&$input) { $v = isset($input[$key]) ? (int)$input[$key] : $default; $v = max($min, min($max, $v)); return $v; }; $text = function($key, $default = '') use (&$input) { $v = isset($input[$key]) ? (string)$input[$key] : $default; return trim($v); }; // Strings $out['api_url'] = rtrim($text('api_url', $existing['api_url'] ?? ''), '/'); $out['fallback_image'] = $text('fallback_image', $existing['fallback_image'] ?? ''); $out['action_separator'] = $text('action_separator', $existing['action_separator'] ?? ' · '); // Zahlen mit Grenzen $out['default_limit'] = $intval('default_limit', 1, 20, (int)($existing['default_limit'] ?? 5)); $out['cache_ttl'] = $intval('cache_ttl', 60, 86400, (int)($existing['cache_ttl'] ?? 300)); $out['image_width'] = $intval('image_width', 40, 600, (int)($existing['image_width'] ?? 120)); $out['excerpt_length'] = $intval('excerpt_length', 40, 400, (int)($existing['excerpt_length'] ?? 160)); $out['card_gap'] = $intval('card_gap', 0, 24, (int)($existing['card_gap'] ?? 0)); $out['card_padding'] = $intval('card_padding', 0, 32, (int)($existing['card_padding'] ?? 3)); $out['group_name_max'] = $intval('group_name_max', 0, 200, (int)($existing['group_name_max'] ?? 0)); // Booleans (Checkboxen) – explizit auf 0 setzen, wenn nicht übermittelt $out['show_images'] = $bool('show_images'); $out['show_group'] = $bool('show_group'); $out['show_site'] = $bool('show_site'); $out['show_excerpt'] = $bool('show_excerpt'); // Enum $btn = $text('button_style', $existing['button_style'] ?? 'button'); $out['button_style'] = in_array($btn, ['button','link'], true) ? $btn : 'button'; return $out; } }
Wie es aussieht, wurde an dieser Stelle nichts gefunden. Möchtest Du danach suchen?
Mit deiner Unterstützung können wir weitere Projekte realisieren und das Bürgerforum weiterentwickeln.
Du kannst ganz einfach per PayPal spenden oder direkt auf unser Konto bei der Volksbank:
IBAN: DE54 6409 1200 0258 3810 00
BIC: GENODES1MTZ
Jede Spende hilft – vielen Dank!
