Update from Git Manager GUI
This commit is contained in:
@@ -1,4 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Minecraft Modern Theme - Customizer Settings
|
||||
*
|
||||
* Enthält Einstellungen für:
|
||||
* - Header Slider & Hero
|
||||
* - Theme Presets (Nether, End, Classic)
|
||||
* - Farben & Darstellung
|
||||
* - Social Media
|
||||
* - Footer
|
||||
* - Login
|
||||
* - Import/Export
|
||||
*/
|
||||
|
||||
function minecraft_modern_customize_register( $wp_customize ) {
|
||||
|
||||
@@ -131,6 +143,34 @@ function minecraft_modern_customize_register( $wp_customize ) {
|
||||
'priority' => 30,
|
||||
) );
|
||||
|
||||
// =========================================================================
|
||||
// === NEU: THEME PRESETS (VOREINSTELLUNGEN) ==============================
|
||||
// =========================================================================
|
||||
|
||||
$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)',
|
||||
),
|
||||
) );
|
||||
|
||||
// =========================================================================
|
||||
// === 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(
|
||||
@@ -211,6 +251,13 @@ function minecraft_modern_customize_register( $wp_customize ) {
|
||||
'label' => 'FAQ System aktivieren', 'section' => 'faq_settings', 'settings' => 'faq_enabled', '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',
|
||||
) );
|
||||
|
||||
// =========================================================================
|
||||
// === 6. LOGIN-BEREICH ====================================================
|
||||
// =========================================================================
|
||||
@@ -457,4 +504,45 @@ function minecraft_modern_dynamic_css_output() {
|
||||
</style>
|
||||
<?php
|
||||
}
|
||||
add_action( 'wp_head', 'minecraft_modern_dynamic_css_output' );
|
||||
add_action( 'wp_head', 'minecraft_modern_dynamic_css_output' );
|
||||
|
||||
// =========================================================================
|
||||
// === THEME PRESET LOGIC (JAVASCRIPT) =====================================
|
||||
// =========================================================================
|
||||
|
||||
/**
|
||||
* Verbindet das Preset-Dropdown mit der Akzentfarbe-Einstellung.
|
||||
* Sobald ein Preset gewählt wird, wird die Farbe im Customizer aktualisiert.
|
||||
*/
|
||||
function minecraft_preset_customize_js() {
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
(function($) {
|
||||
// Definiere die Farben für die Presets
|
||||
var presetColors = {
|
||||
'classic': '#00d4ff', // Diamant Blau
|
||||
'nether': '#ff3333', // Lava Rot
|
||||
'end': '#aa00ff' // Ender Purpur
|
||||
};
|
||||
|
||||
// Warten bis der Customizer bereit ist
|
||||
wp.customize.bind('ready', function() {
|
||||
|
||||
// Listener für das Preset-Dropdown
|
||||
wp.customize('theme_color_preset', function(setting) {
|
||||
setting.bind(function(to) {
|
||||
// Wenn eine Farbe für das gewählte Preset existiert...
|
||||
if (presetColors[to]) {
|
||||
// ...setze die Akzentfarbe auf diesen Wert.
|
||||
// Das aktualisiert auch den Color Picker und die Live-Vorschau.
|
||||
wp.customize('primary_accent_color').set(presetColors[to]);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
})(jQuery);
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
add_action('customize_controls_print_footer_scripts', 'minecraft_preset_customize_js');
|
||||
@@ -7,7 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
||||
// === ZENTRALE VERSIONSKONSTANTE ===
|
||||
// Bitte passen Sie diese Version bei jedem Release an!
|
||||
define( 'MINECRAFT_MODERN_THEME_VERSION', '1.5' );
|
||||
define( 'MINECRAFT_MODERN_THEME_VERSION', '1.6' );
|
||||
|
||||
|
||||
// === THEME UPDATE NOTIFICATION SYSTEM ===
|
||||
|
||||
Reference in New Issue
Block a user