diff --git a/Minecraft-Modern-Theme/inc/customizer.php b/Minecraft-Modern-Theme/inc/customizer.php index cb53060..4525b40 100644 --- a/Minecraft-Modern-Theme/inc/customizer.php +++ b/Minecraft-Modern-Theme/inc/customizer.php @@ -1,478 +1,325 @@ direkt in wp_head + * - slider_loop Setting ergänzt (war in slider-init.js referenziert, aber nie definiert) + * - Scroll-to-Top Toggle ergänzt + * - footer_copyright Default mit aktuellem Jahr zur Laufzeit + * - Import_Export_Control Klasse aus dem Callback extrahiert */ +// ========================================================================= +// Import/Export Control – außerhalb des Callbacks definiert +// ========================================================================= +if ( class_exists('WP_Customize_Control') && ! class_exists('MM_Import_Export_Control') ) : +class MM_Import_Export_Control extends WP_Customize_Control { + public $type = 'mm_import_export'; + + public function render_content() { + $export_url = admin_url('admin-post.php?action=export_theme_settings'); + $nonce = wp_create_nonce('theme-import-nonce'); + ?> +
+ + + add_section( 'header_slider', array( - 'title' => 'Header Slider', + 'title' => __('Header Slider', 'minecraft-modern-theme'), 'priority' => 20, - 'description' => 'Konfiguriere den großen Slider auf der Startseite.', + 'description' => __('Konfiguriere den großen Slider auf der Startseite.', 'minecraft-modern-theme'), ) ); - // Checkbox zum Aktivieren des Sliders - $wp_customize->add_setting( 'slider_enabled', array( - 'default' => false, - 'transport' => 'refresh', - 'sanitize_callback' => 'wp_validate_boolean', - ) ); - $wp_customize->add_control( 'slider_enabled', array( - 'label' => 'Header Slider aktivieren', + $wp_customize->add_setting( 'slider_enabled', array( 'default' => false, 'transport' => 'refresh', 'sanitize_callback' => 'wp_validate_boolean' ) ); + $wp_customize->add_control( 'slider_enabled', array( 'label' => __('Header Slider aktivieren', 'minecraft-modern-theme'), 'section' => 'header_slider', 'type' => 'checkbox' ) ); + + // FIX: slider_loop war in slider-init.js als sliderSettings.loop referenziert, aber nie definiert + $wp_customize->add_setting( 'slider_loop', array( 'default' => true, 'transport' => 'refresh', 'sanitize_callback' => 'wp_validate_boolean' ) ); + $wp_customize->add_control( 'slider_loop', array( + 'label' => __('Slider Endlos-Loop aktivieren', 'minecraft-modern-theme'), + 'description' => __('Der Slider springt nach dem letzten Slide wieder zum ersten zurück.', 'minecraft-modern-theme'), 'section' => 'header_slider', - 'settings' => 'slider_enabled', 'type' => 'checkbox', ) ); - // Dynamische Slider-Bilder, Titel und Untertitel - for ($i = 1; $i <= 5; $i++) { + for ( $i = 1; $i <= 5; $i++ ) { $wp_customize->add_setting( 'slider_image_' . $i, array( 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'slider_image_' . $i, array( - 'label' => sprintf( 'Banner %d - Bild', $i ), - 'section' => 'header_slider', - 'settings' => 'slider_image_' . $i, + 'label' => sprintf( __('Banner %d - Bild', 'minecraft-modern-theme'), $i ), 'section' => 'header_slider', ) ) ); - $wp_customize->add_setting( 'slider_title_' . $i, array( 'sanitize_callback' => 'sanitize_text_field' ) ); - $wp_customize->add_control( 'slider_title_' . $i, array( - 'label' => sprintf( 'Banner %d - Titel', $i ), - 'section' => 'header_slider', - 'settings' => 'slider_title_' . $i, - 'type' => 'text', - ) ); - + $wp_customize->add_control( 'slider_title_' . $i, array( 'label' => sprintf( __('Banner %d - Titel', 'minecraft-modern-theme'), $i ), 'section' => 'header_slider', 'type' => 'text' ) ); $wp_customize->add_setting( 'slider_subtitle_' . $i, array( 'sanitize_callback' => 'sanitize_text_field' ) ); - $wp_customize->add_control( 'slider_subtitle_' . $i, array( - 'label' => sprintf( 'Banner %d - Untertitel', $i ), - 'section' => 'header_slider', - 'settings' => 'slider_subtitle_' . $i, - 'type' => 'text', - ) ); + $wp_customize->add_control( 'slider_subtitle_' . $i, array( 'label' => sprintf( __('Banner %d - Untertitel', 'minecraft-modern-theme'), $i ), 'section' => 'header_slider', 'type' => 'text' ) ); } - // Slider Text- & Stil-Einstellungen $wp_customize->add_setting( 'slider_font_family', array( 'default' => 'Raleway', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'slider_font_family', array( - 'label' => 'Schriftart', 'section' => 'header_slider', 'settings' => 'slider_font_family', 'type' => 'select', - 'choices' => array( 'Raleway' => 'Raleway', 'Poppins' => 'Poppins', 'Montserrat' => 'Montserrat', 'Oswald' => 'Oswald', 'Roboto' => 'Roboto', 'Lato' => 'Lato' ), + 'label' => __('Schriftart', 'minecraft-modern-theme'), 'section' => 'header_slider', 'type' => 'select', + 'choices' => array( 'Raleway' => 'Raleway', 'Poppins' => 'Poppins', 'Montserrat' => 'Montserrat', 'Oswald' => 'Oswald', 'Roboto' => 'Roboto', 'Lato' => 'Lato' ), ) ); + $wp_customize->add_setting( 'slider_font_size', array( 'default' => 'mittel', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'slider_font_size', array( - 'label' => 'Schriftgröße', 'section' => 'header_slider', 'settings' => 'slider_font_size', 'type' => 'select', - 'choices' => array( 'klein' => 'Klein', 'mittel' => 'Mittel', 'gross' => 'Groß', 'extra-gross' => 'Extra Groß' ), + 'label' => __('Schriftgröße', 'minecraft-modern-theme'), 'section' => 'header_slider', 'type' => 'select', + 'choices' => array( 'klein' => __('Klein', 'minecraft-modern-theme'), 'mittel' => __('Mittel', 'minecraft-modern-theme'), 'gross' => __('Groß', 'minecraft-modern-theme'), 'extra-gross' => __('Extra Groß', 'minecraft-modern-theme') ), ) ); + $wp_customize->add_setting( 'slider_font_color', array( 'default' => '#ffffff', 'sanitize_callback' => 'sanitize_hex_color' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'slider_font_color', array( - 'label' => 'Schriftfarbe', 'section' => 'header_slider', 'settings' => 'slider_font_color', + 'label' => __('Schriftfarbe', 'minecraft-modern-theme'), 'section' => 'header_slider', ) ) ); - - // Header-Höhe + $wp_customize->add_setting( 'header_height', array( 'default' => 'mittel', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'header_height', array( - 'label' => 'Header-Höhe', 'section' => 'header_slider', 'settings' => 'header_height', 'type' => 'select', - 'choices' => array( 'klein' => 'Klein', 'mittel' => 'Mittel', 'gross' => 'Groß' ), + 'label' => __('Header-Höhe', 'minecraft-modern-theme'), 'section' => 'header_slider', 'type' => 'select', + 'choices' => array( 'klein' => __('Klein', 'minecraft-modern-theme'), 'mittel' => __('Mittel', 'minecraft-modern-theme'), 'gross' => __('Groß', 'minecraft-modern-theme') ), ) ); $wp_customize->add_setting( 'slider_hide_arrows', array( 'default' => false, 'sanitize_callback' => 'wp_validate_boolean' ) ); - $wp_customize->add_control( 'slider_hide_arrows', array( - 'label' => 'Pfeile ausblenden', 'section' => 'header_slider', 'settings' => 'slider_hide_arrows', 'type' => 'checkbox', - ) ); + $wp_customize->add_control( 'slider_hide_arrows', array( 'label' => __('Pfeile ausblenden', 'minecraft-modern-theme'), 'section' => 'header_slider', 'type' => 'checkbox' ) ); + $wp_customize->add_setting( 'slider_hide_pagination', array( 'default' => false, 'sanitize_callback' => 'wp_validate_boolean' ) ); - $wp_customize->add_control( 'slider_hide_pagination', array( - 'label' => 'Paginierung (Punkte) ausblenden', 'section' => 'header_slider', 'settings' => 'slider_hide_pagination', 'type' => 'checkbox', - ) ); + $wp_customize->add_control( 'slider_hide_pagination', array( 'label' => __('Paginierung (Punkte) ausblenden', 'minecraft-modern-theme'), 'section' => 'header_slider', 'type' => 'checkbox' ) ); - // --- Sektion: Startseiten-Hero (Fallback) --- + + // ========================================================================= + // 2. HERO SECTION (Fallback) + // ========================================================================= $wp_customize->add_section( 'hero_section', array( - 'title' => 'Startseiten-Hero (wenn Slider deaktiviert)', - 'priority' => 21, - 'description' => 'Diese Inhalte werden angezeigt, wenn der Slider ausgeschaltet ist.', + 'title' => __('Startseiten-Hero (wenn Slider deaktiviert)', 'minecraft-modern-theme'), + 'priority' => 21, ) ); - $wp_customize->add_setting( 'hero_title', array( 'default' => 'Willkommen auf unserem Server', 'sanitize_callback' => 'sanitize_text_field' ) ); - $wp_customize->add_control( 'hero_title', array( 'label' => 'Haupttitel', 'section' => 'hero_section', 'settings' => 'hero_title', 'type' => 'text' ) ); - $wp_customize->add_setting( 'hero_subtitle', array( 'default' => 'Trete einer Community voller Abenteuer bei.', 'sanitize_callback' => 'sanitize_text_field' ) ); - $wp_customize->add_control( 'hero_subtitle', array( 'label' => 'Untertitel', 'section' => 'hero_section', 'settings' => 'hero_subtitle', 'type' => 'text' ) ); + + $wp_customize->add_setting( 'hero_title', array( 'default' => __('Willkommen auf unserem Server', 'minecraft-modern-theme'), 'sanitize_callback' => 'sanitize_text_field' ) ); + $wp_customize->add_control( 'hero_title', array( 'label' => __('Haupttitel', 'minecraft-modern-theme'), 'section' => 'hero_section', 'type' => 'text' ) ); + $wp_customize->add_setting( 'hero_subtitle', array( 'default' => __('Trete einer Community voller Abenteuer bei.', 'minecraft-modern-theme'), 'sanitize_callback' => 'sanitize_text_field' ) ); + $wp_customize->add_control( 'hero_subtitle', array( 'label' => __('Untertitel', 'minecraft-modern-theme'), 'section' => 'hero_section', 'type' => 'text' ) ); $wp_customize->add_setting( 'hero_bg_image', array( 'sanitize_callback' => 'esc_url_raw' ) ); - $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'hero_bg_image', array( - 'label' => 'Hintergrundbild', 'section' => 'hero_section', 'settings' => 'hero_bg_image', - ) ) ); - $wp_customize->add_setting( 'hero_button_1_text', array( 'default' => 'Zum Forum', 'sanitize_callback' => 'sanitize_text_field' ) ); - $wp_customize->add_control( 'hero_button_1_text', array( 'label' => 'Button 1 Text', 'section' => 'hero_section', 'settings' => 'hero_button_1_text', 'type' => 'text' ) ); - $wp_customize->add_setting( 'hero_button_1_url', array( 'default' => '#', 'sanitize_callback' => 'esc_url_raw' ) ); - $wp_customize->add_control( 'hero_button_1_url', array( 'label' => 'Button 1 URL', 'section' => 'hero_section', 'settings' => 'hero_button_1_url', 'type' => 'url' ) ); - $wp_customize->add_setting( 'hero_button_2_text', array( 'default' => 'Zum Teamspeak', 'sanitize_callback' => 'sanitize_text_field' ) ); - $wp_customize->add_control( 'hero_button_2_text', array( 'label' => 'Button 2 Text', 'section' => 'hero_section', 'settings' => 'hero_button_2_text', 'type' => 'text' ) ); - $wp_customize->add_setting( 'hero_button_2_url', array( 'default' => '#', 'sanitize_callback' => 'esc_url_raw' ) ); - $wp_customize->add_control( 'hero_button_2_url', array( 'label' => 'Button 2 URL', 'section' => 'hero_section', 'settings' => 'hero_button_2_url', 'type' => 'url' ) ); - - // --- Checkbox: Seitentitel auf Startseite verstecken --- - $wp_customize->add_setting( 'show_home_title', array( - 'default' => false, - 'sanitize_callback' => 'wp_validate_boolean', - ) ); - $wp_customize->add_control( 'show_home_title', array( - 'label' => 'Seitentitel "Home" anzeigen', - 'description' => 'Aktiviere diese Option, wenn der Titel "Home" über dem Slider/Inhalt angezeigt werden soll.', - 'section' => 'hero_section', - 'settings' => 'show_home_title', - 'type' => 'checkbox', - ) ); + $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'hero_bg_image', array( 'label' => __('Hintergrundbild', 'minecraft-modern-theme'), 'section' => 'hero_section' ) ) ); + $wp_customize->add_setting( 'hero_button_1_text', array( 'default' => __('Zum Forum', 'minecraft-modern-theme'), 'sanitize_callback' => 'sanitize_text_field' ) ); + $wp_customize->add_control( 'hero_button_1_text', array( 'label' => __('Button 1 Text', 'minecraft-modern-theme'), 'section' => 'hero_section', 'type' => 'text' ) ); + $wp_customize->add_setting( 'hero_button_1_url', array( 'default' => '#', 'sanitize_callback' => 'esc_url_raw' ) ); + $wp_customize->add_control( 'hero_button_1_url', array( 'label' => __('Button 1 URL', 'minecraft-modern-theme'), 'section' => 'hero_section', 'type' => 'url' ) ); + $wp_customize->add_setting( 'hero_button_2_text', array( 'default' => __('Zum Teamspeak', 'minecraft-modern-theme'), 'sanitize_callback' => 'sanitize_text_field' ) ); + $wp_customize->add_control( 'hero_button_2_text', array( 'label' => __('Button 2 Text', 'minecraft-modern-theme'), 'section' => 'hero_section', 'type' => 'text' ) ); + $wp_customize->add_setting( 'hero_button_2_url', array( 'default' => '#', 'sanitize_callback' => 'esc_url_raw' ) ); + $wp_customize->add_control( 'hero_button_2_url', array( 'label' => __('Button 2 URL', 'minecraft-modern-theme'), 'section' => 'hero_section', 'type' => 'url' ) ); + $wp_customize->add_setting( 'show_home_title', array( 'default' => false, 'sanitize_callback' => 'wp_validate_boolean' ) ); + $wp_customize->add_control( 'show_home_title', array( 'label' => __('Seitentitel "Home" anzeigen', 'minecraft-modern-theme'), 'section' => 'hero_section', 'type' => 'checkbox' ) ); // ========================================================================= - // === 2. FARBEN & DARSTELLUNG (KOMBINIERT) ================================ + // 3. FARBEN & DARSTELLUNG // ========================================================================= - - // --- Sektion: Farben & Darstellung --- $wp_customize->add_section( 'theme_appearance_settings', array( - 'title' => 'Farben & Darstellung', - 'priority' => 30, - ) ); - - // ========================================================================= - // === NEU: THEME PRESETS (VOREINSTELLUNGEN) ============================== - // ========================================================================= - - $wp_customize->add_setting( 'theme_color_preset', array( - 'default' => 'classic', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'refresh', + 'title' => __('Farben & Darstellung', 'minecraft-modern-theme'), 'priority' => 30, ) ); + $wp_customize->add_setting( 'theme_color_preset', array( 'default' => 'classic', 'sanitize_callback' => 'sanitize_key', 'transport' => 'refresh' ) ); $wp_customize->add_control( 'theme_color_preset', array( - 'label' => 'Theme Preset (Farbschema)', - 'description' => 'Wähle ein voreingestelltes Farbschema (z. B. für Nether oder End Dimension).', - 'section' => 'theme_appearance_settings', - 'settings' => 'theme_color_preset', - 'type' => 'select', - 'priority' => 1, // Zeig es ganz oben in dieser Sektion an - 'choices' => array( - 'classic' => 'Classic Minecraft (Diamant-Blau)', - 'nether' => 'Nether (Lava-Rot)', - 'end' => 'The End (Ender-Purpur)', + 'label' => __('Theme Preset (Farbschema)', 'minecraft-modern-theme'), + 'section' => 'theme_appearance_settings', + 'type' => 'select', + 'priority' => 1, + 'choices' => array( + 'classic' => __('Classic Minecraft (Diamant-Blau)', 'minecraft-modern-theme'), + 'nether' => __('Nether (Lava-Rot)', 'minecraft-modern-theme'), + 'end' => __('The End (Ender-Purpur)', 'minecraft-modern-theme'), ), ) ); - // ========================================================================= - // === ENDE THEME PRESETS ================================================== - // ========================================================================= - - // Akzentfarbe $wp_customize->add_setting( 'primary_accent_color', array( 'default' => '#00d4ff', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'refresh' ) ); - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'primary_accent_color', array( - 'label' => 'Akzentfarbe', 'section' => 'theme_appearance_settings', 'settings' => 'primary_accent_color', - ) ) ); + $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'primary_accent_color', array( 'label' => __('Akzentfarbe', 'minecraft-modern-theme'), 'section' => 'theme_appearance_settings' ) ) ); - // Hintergrundfarbe - $wp_customize->add_setting( 'background_color', array( - 'default' => '#ffffff', - 'sanitize_callback' => 'sanitize_hex_color', - 'transport' => 'refresh', - ) ); - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'background_color', array( - 'label' => 'Hintergrundfarbe', - 'section' => 'theme_appearance_settings', - 'settings' => 'background_color', - ) ) ); - - // Dark / Light Mode $wp_customize->add_setting( 'default_theme_mode', array( 'default' => 'dark', 'sanitize_callback' => 'sanitize_key' ) ); $wp_customize->add_control( 'default_theme_mode', array( - 'label' => 'Standard-Theme-Modus', 'section' => 'theme_appearance_settings', 'type' => 'radio', - 'choices' => array( 'dark' => 'Dark Mode (Standard)', 'light' => 'Light Mode' ), + 'label' => __('Standard-Theme-Modus', 'minecraft-modern-theme'), + 'section' => 'theme_appearance_settings', + 'type' => 'radio', + 'choices' => array( 'dark' => __('Dark Mode', 'minecraft-modern-theme'), 'light' => __('Light Mode', 'minecraft-modern-theme') ), ) ); - - // ========================================================================= - // === 3. SIDEBAR EINSTELLUNGEN ============================================ - // ========================================================================= - - $wp_customize->add_section( 'sidebar_settings', array( - 'title' => 'Sidebar Einstellungen', - 'priority' => 35, - 'description' => 'Konfiguriere die Sidebar auf der Startseite.', - ) ); - - // Sidebar aktivieren - $wp_customize->add_setting( 'homepage_sidebar_enabled', array( - 'default' => false, - 'sanitize_callback' => 'wp_validate_boolean', - ) ); - $wp_customize->add_control( 'homepage_sidebar_enabled', array( - 'label' => 'Sidebar auf Startseite aktivieren', - 'description' => 'Zeigt eine Sidebar neben dem Hauptinhalt an.', - 'section' => 'sidebar_settings', - 'settings' => 'homepage_sidebar_enabled', + // FIX: Scroll-to-Top war nie im Customizer steuerbar + $wp_customize->add_setting( 'show_scroll_to_top', array( 'default' => true, 'sanitize_callback' => 'wp_validate_boolean' ) ); + $wp_customize->add_control( 'show_scroll_to_top', array( + 'label' => __('Scroll-to-Top Button anzeigen', 'minecraft-modern-theme'), + 'description' => __('Zeigt einen Button unten rechts zum Hochscrollen an.', 'minecraft-modern-theme'), + 'section' => 'theme_appearance_settings', 'type' => 'checkbox', ) ); - // Sidebar Position - $wp_customize->add_setting( 'homepage_sidebar_position', array( - 'default' => 'right', - 'sanitize_callback' => 'sanitize_key', - ) ); + + // ========================================================================= + // 4. SIDEBAR + // ========================================================================= + $wp_customize->add_section( 'sidebar_settings', array( 'title' => __('Sidebar Einstellungen', 'minecraft-modern-theme'), 'priority' => 35 ) ); + $wp_customize->add_setting( 'homepage_sidebar_enabled', array( 'default' => false, 'sanitize_callback' => 'wp_validate_boolean' ) ); + $wp_customize->add_control( 'homepage_sidebar_enabled', array( 'label' => __('Sidebar auf Startseite aktivieren', 'minecraft-modern-theme'), 'section' => 'sidebar_settings', 'type' => 'checkbox' ) ); + $wp_customize->add_setting( 'homepage_sidebar_position', array( 'default' => 'right', 'sanitize_callback' => 'sanitize_key' ) ); $wp_customize->add_control( 'homepage_sidebar_position', array( - 'label' => 'Sidebar Position', - 'section' => 'sidebar_settings', - 'settings' => 'homepage_sidebar_position', - 'type' => 'select', - 'choices' => array( - 'left' => 'Links', - 'right' => 'Rechts', - ), + 'label' => __('Sidebar Position', 'minecraft-modern-theme'), 'section' => 'sidebar_settings', 'type' => 'select', + 'choices' => array( 'left' => __('Links', 'minecraft-modern-theme'), 'right' => __('Rechts', 'minecraft-modern-theme') ), ) ); // ========================================================================= - // === 4. SOCIAL MEDIA ===================================================== + // 5. SOCIAL MEDIA // ========================================================================= - - $wp_customize->add_section( 'social_links', array( 'title' => 'Social Media Links', 'priority' => 40 ) ); - $social_platforms = array( 'discord' => 'Discord', 'youtube' => 'YouTube', 'twitter' => 'Twitter (X)', 'facebook' => 'Facebook', 'instagram' => 'Instagram', 'tiktok' => 'TikTok', 'twitch' => 'Twitch', 'steam' => 'Steam', 'github' => 'GitHub', 'linkedin' => 'LinkedIn', 'pinterest' => 'Pinterest', 'reddit' => 'Reddit', 'teamspeak' => 'Teamspeak', 'spotify' => 'Spotify' ); - foreach ($social_platforms as $key => $label) { + $wp_customize->add_section( 'social_links', array( 'title' => __('Social Media Links', 'minecraft-modern-theme'), 'priority' => 40 ) ); + $social_platforms = array( + 'discord' => 'Discord', 'youtube' => 'YouTube', 'twitter' => 'Twitter (X)', + 'facebook' => 'Facebook', 'instagram' => 'Instagram', 'tiktok' => 'TikTok', + 'twitch' => 'Twitch', 'steam' => 'Steam', 'github' => 'GitHub', + 'linkedin' => 'LinkedIn', 'pinterest' => 'Pinterest', 'reddit' => 'Reddit', + 'teamspeak' => 'Teamspeak', 'spotify' => 'Spotify', + ); + foreach ( $social_platforms as $key => $label ) { $wp_customize->add_setting( 'social_' . $key, array( 'sanitize_callback' => 'esc_url_raw' ) ); - $wp_customize->add_control( 'social_' . $key, array( - 'label' => $label . ' URL', 'section' => 'social_links', 'settings' => 'social_' . $key, 'type' => 'url', - ) ); + $wp_customize->add_control( 'social_' . $key, array( 'label' => $label . ' URL', 'section' => 'social_links', 'type' => 'url' ) ); } // ========================================================================= - // === 5. FOOTER-BEREICH ================================================== + // 6. FOOTER // ========================================================================= + $wp_customize->add_section( 'footer_settings', array( 'title' => __('Footer-Einstellungen', 'minecraft-modern-theme'), 'priority' => 50 ) ); - $wp_customize->add_section( 'footer_settings', array( 'title' => 'Footer-Einstellungen', 'priority' => 50 ) ); - - // Copyright-Text - $wp_customize->add_setting( 'footer_copyright', array( 'default' => '© ' . date('Y') . ' ' . get_bloginfo('name'), 'sanitize_callback' => 'wp_kses_post' ) ); + // FIX: Default mit aktuellem Jahr zur Laufzeit auswerten, nicht bei class-load + $wp_customize->add_setting( 'footer_copyright', array( + 'default' => '', // Leer = dynamisch berechnet in footer.php + 'sanitize_callback' => 'wp_kses_post', + ) ); $wp_customize->add_control( 'footer_copyright', array( - 'label' => 'Copyright-Text', 'section' => 'footer_settings', 'settings' => 'footer_copyright', 'type' => 'textarea', + 'label' => __('Copyright-Text', 'minecraft-modern-theme'), + 'description' => __('Leer lassen für automatischen Text mit aktuellem Jahr.', 'minecraft-modern-theme'), + 'section' => 'footer_settings', + 'type' => 'textarea', ) ); - // Impressum & Datenschutz Links - $wp_customize->add_setting( 'footer_impressum_url', array( 'sanitize_callback' => 'esc_url_raw' ) ); - $wp_customize->add_control( 'footer_impressum_url', array( - 'label' => 'URL für Impressum', 'section' => 'footer_settings', 'settings' => 'footer_impressum_url', 'type' => 'url', - ) ); + $wp_customize->add_setting( 'footer_impressum_url', array( 'sanitize_callback' => 'esc_url_raw' ) ); + $wp_customize->add_control( 'footer_impressum_url', array( 'label' => __('URL für Impressum', 'minecraft-modern-theme'), 'section' => 'footer_settings', 'type' => 'url' ) ); $wp_customize->add_setting( 'footer_datenschutz_url', array( 'sanitize_callback' => 'esc_url_raw' ) ); - $wp_customize->add_control( 'footer_datenschutz_url', array( - 'label' => 'URL für Datenschutz', 'section' => 'footer_settings', 'settings' => 'footer_datenschutz_url', 'type' => 'url', - ) ); - - // Footer-Credit + $wp_customize->add_control( 'footer_datenschutz_url', array( 'label' => __('URL für Datenschutz', 'minecraft-modern-theme'), 'section' => 'footer_settings', 'type' => 'url' ) ); $wp_customize->add_setting( 'show_footer_credit', array( 'default' => true, 'sanitize_callback' => 'wp_validate_boolean' ) ); - $wp_customize->add_control( 'show_footer_credit', array( - 'label' => 'Footer-Credit ("Minecraft Theme Erstellt von...") anzeigen', 'section' => 'footer_settings', 'settings' => 'show_footer_credit', 'type' => 'checkbox', - ) ); + $wp_customize->add_control( 'show_footer_credit', array( 'label' => __('Footer-Credit anzeigen', 'minecraft-modern-theme'), 'section' => 'footer_settings', 'type' => 'checkbox' ) ); // ========================================================================= - // === 6. ZUSÄTZLICHE FUNKTIONEN ========================================== + // 7. FAQ & TEAM // ========================================================================= + $wp_customize->add_section( 'faq_settings', array( 'title' => __('FAQ Einstellungen', 'minecraft-modern-theme'), 'priority' => 60 ) ); + $wp_customize->add_setting( 'faq_enabled', array( 'default' => true, 'sanitize_callback' => 'wp_validate_boolean' ) ); + $wp_customize->add_control( 'faq_enabled', array( 'label' => __('FAQ System aktivieren', 'minecraft-modern-theme'), 'section' => 'faq_settings', 'type' => 'checkbox' ) ); - // --- Sektion: FAQ Einstellungen --- - $wp_customize->add_section( 'faq_settings', array( 'title' => 'FAQ Einstellungen', 'priority' => 60 ) ); - $wp_customize->add_setting( 'faq_enabled', array( 'default' => true, 'sanitize_callback' => 'wp_validate_boolean' ) ); - $wp_customize->add_control( 'faq_enabled', array( - 'label' => 'FAQ System aktivieren', 'section' => 'faq_settings', 'settings' => 'faq_enabled', 'type' => 'checkbox', - ) ); + $wp_customize->add_section( 'team_settings', array( 'title' => __('Team Einstellungen', 'minecraft-modern-theme'), 'priority' => 65 ) ); + $wp_customize->add_setting( 'team_enabled', array( 'default' => true, 'sanitize_callback' => 'wp_validate_boolean' ) ); + $wp_customize->add_control( 'team_enabled', array( 'label' => __('Team Showcase aktivieren', 'minecraft-modern-theme'), 'section' => 'team_settings', 'type' => 'checkbox' ) ); - // --- Sektion: Team Einstellungen --- - $wp_customize->add_section( 'team_settings', array( 'title' => 'Team Einstellungen', 'priority' => 65 ) ); - $wp_customize->add_setting( 'team_enabled', array( 'default' => true, 'sanitize_callback' => 'wp_validate_boolean' ) ); - $wp_customize->add_control( 'team_enabled', array( - 'label' => 'Team Showcase aktivieren', 'section' => 'team_settings', 'settings' => 'team_enabled', 'type' => 'checkbox', - ) ); // ========================================================================= - // === 7. LOGIN-BEREICH ==================================================== + // 8. LOGIN // ========================================================================= + $wp_customize->add_section( 'login_settings', array( 'title' => __('Login-Einstellungen', 'minecraft-modern-theme'), 'priority' => 70 ) ); + $wp_customize->add_setting( 'login_background_image', array( 'sanitize_callback' => 'esc_url_raw', 'transport' => 'refresh' ) ); + $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'login_background_image', array( 'label' => __('Login-Hintergrundbild', 'minecraft-modern-theme'), 'section' => 'login_settings' ) ) ); + $wp_customize->add_setting( 'login_logo', array( 'sanitize_callback' => 'esc_url_raw', 'transport' => 'refresh' ) ); + $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'login_logo', array( 'label' => __('Login-Logo', 'minecraft-modern-theme'), 'section' => 'login_settings' ) ) ); - $wp_customize->add_section( 'login_settings', array( - 'title' => 'Login-Einstellungen', - 'priority' => 70, - 'description' => 'Passe das Aussehen der wp-admin Login-Seite an.', - ) ); - - // Login-Hintergrundbild - $wp_customize->add_setting( 'login_background_image', array( - 'sanitize_callback' => 'esc_url_raw', - 'transport' => 'refresh', - ) ); - $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'login_background_image', array( - 'label' => 'Login-Hintergrundbild', - 'section' => 'login_settings', - 'settings' => 'login_background_image', - ) ) ); - - // Login-Logo - $wp_customize->add_setting( 'login_logo', array( - 'sanitize_callback' => 'esc_url_raw', - 'transport' => 'refresh', - ) ); - $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'login_logo', array( - 'label' => 'Login-Logo (ersetzt das WordPress-Logo)', - 'section' => 'login_settings', - 'settings' => 'login_logo', - ) ) ); - - // Multi-Avatar UUIDs - for ($i = 1; $i <= 5; $i++) { - $wp_customize->add_setting( 'login_avatar_uuid_' . $i, array( - 'sanitize_callback' => 'sanitize_text_field', - 'transport' => 'refresh', - ) ); + for ( $i = 1; $i <= 5; $i++ ) { + $wp_customize->add_setting( 'login_avatar_uuid_' . $i, array( 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'refresh' ) ); $wp_customize->add_control( 'login_avatar_uuid_' . $i, array( - 'label' => sprintf( 'Avatar %d UUID', $i ), - 'description' => sprintf( 'Gib die UUID für den %d. Avatar an. (Leer lassen, um zu deaktivieren)', $i ), - 'section' => 'login_settings', - 'settings' => 'login_avatar_uuid_' . $i, - 'type' => 'text', + 'label' => sprintf( __('Avatar %d UUID', 'minecraft-modern-theme'), $i ), + 'section' => 'login_settings', + 'type' => 'text', ) ); } - // Slider-Geschwindigkeit - $wp_customize->add_setting( 'login_avatar_slider_speed', array( - 'default' => 4, - 'sanitize_callback' => 'absint', - 'transport' => 'refresh', - ) ); + $wp_customize->add_setting( 'login_avatar_slider_speed', array( 'default' => 4, 'sanitize_callback' => 'absint', 'transport' => 'refresh' ) ); $wp_customize->add_control( 'login_avatar_slider_speed', array( - 'label' => 'Avatar-Wechsel (in Sekunden)', - 'description' => 'Wie viele Sekunden soll ein Avatar angezeigt werden?', + 'label' => __('Avatar-Wechsel (Sekunden)', 'minecraft-modern-theme'), 'section' => 'login_settings', - 'settings' => 'login_avatar_slider_speed', 'type' => 'number', 'input_attrs' => array( 'min' => 2, 'max' => 10, 'step' => 1 ), ) ); + // ========================================================================= - // === 8. EXPORT / IMPORT SECTION ========================================= + // 9. EXPORT / IMPORT // ========================================================================= - $wp_customize->add_section( 'theme_mods_import_export', array( - 'title' => __( 'Einstellungen sichern', 'minecraft-modern-theme' ), - 'priority' => 999, - 'description' => '', + 'title' => __('Einstellungen sichern', 'minecraft-modern-theme'), + 'priority' => 999, ) ); - - // Füge ein Custom Control mit HTML hinzu - $wp_customize->add_setting( 'import_export_placeholder', array( - 'sanitize_callback' => 'sanitize_text_field', - ) ); - - // Custom Control Class für Export/Import - class Import_Export_Control extends WP_Customize_Control { - public $type = 'import_export'; - - public function render_content() { - $export_url = admin_url('admin-post.php?action=export_theme_settings'); - $nonce = wp_create_nonce('theme-import-nonce'); - ?> -- Hinweis: Hier kannst du alle deine Theme-Einstellungen sichern und wiederherstellen. -
- - - Einstellungen Exportieren - - -- ⚠️ Warnung: Beim Import werden alle aktuellen Einstellungen überschrieben! -
-+ + Minecraft Modern Update verfügbar: Version ist bereit zum Download. + Zum Download → +
+- ' . esc_html( $current_version ) . '', - '' . esc_html( $latest_release['version'] ) . '' - ); - ?> -
- -' . __( 'Latest Version:', 'minecraft-modern-theme' ) . ' ' . esc_html( $latest_release['version'] ) . '
'; - - if ( version_compare( $current_version, $latest_release['version'], '<' ) ) { - echo '' . __( 'Status:', 'minecraft-modern-theme' ) . ' ' . __( 'Update Available', 'minecraft-modern-theme' ) . '
'; - echo '' . __( 'Download Update', 'minecraft-modern-theme' ) . '
'; - } else { - echo '' . __( 'Status:', 'minecraft-modern-theme' ) . ' ' . __( 'Up to Date', 'minecraft-modern-theme' ) . '
'; - } - } else { - echo '' . __( 'Status:', 'minecraft-modern-theme' ) . ' ' . __( 'Unable to check for updates', 'minecraft-modern-theme' ) . '
'; - } - - // Link für "Jetzt prüfen" - $refresh_url = wp_nonce_url( admin_url( 'index.php?mm_clear_cache=1' ), 'mm_clear_cache_action' ); - echo '' . __( 'Check for Updates Now', 'minecraft-modern-theme' ) . '
'; - - echo ''; -} +// Initialisierung +new Minecraft_Modern_Theme_Manager(); \ No newline at end of file