30 Commits
1.7 ... main

Author SHA1 Message Date
9df80d7237 Upload single-faq.php via GUI 2026-02-11 21:11:37 +00:00
27f6a15aae Upload single.php via GUI 2026-02-11 21:11:37 +00:00
638808d9dd Upload page-login.php via GUI 2026-02-11 21:11:29 +00:00
ca9815ea65 Upload page.php via GUI 2026-02-11 21:11:29 +00:00
568acd83d1 Upload index.php via GUI 2026-02-11 21:11:28 +00:00
985ba164a1 Upload header.php via GUI 2026-02-11 21:11:28 +00:00
77536986ab Upload functions.php via GUI 2026-02-11 21:11:28 +00:00
39e9b298d9 Upload front-page.php via GUI 2026-02-11 21:11:27 +00:00
37b31a6109 Upload footer.php via GUI 2026-02-11 21:11:27 +00:00
b7276ff373 Upload dynamic-styles.php via GUI 2026-02-11 21:11:26 +00:00
02b94594b9 Upload archive-team.php via GUI 2026-02-11 21:11:26 +00:00
d76950645e Upload archive-faq.php via GUI 2026-02-11 21:11:25 +00:00
dbea7c74f3 Upload style.css via GUI 2026-02-11 21:11:21 +00:00
ae10138d51 Minecraft-Modern-Theme/inc/theme-updater.php aktualisiert 2026-02-11 18:56:35 +00:00
991d9c38c8 Minecraft-Modern-Theme/front-page.php aktualisiert 2026-02-11 18:49:07 +00:00
4ad76fabf6 Minecraft-Modern-Theme/style.css aktualisiert 2026-02-11 18:48:35 +00:00
d46684dc7e Upload archive-team.php via GUI 2026-02-10 22:26:02 +00:00
dc14b838d6 Upload archive-faq.php via GUI 2026-02-10 22:26:02 +00:00
f397108cf0 Update from Git Manager GUI 2026-02-10 23:25:59 +01:00
6896f6aa26 Upload index.php via GUI 2026-02-10 22:25:56 +00:00
e119411758 Upload header.php via GUI 2026-02-10 22:25:55 +00:00
50c636a17f Upload functions.php via GUI 2026-02-10 22:25:55 +00:00
9051f74598 Upload front-page.php via GUI 2026-02-10 22:25:54 +00:00
777a999fed Upload footer.php via GUI 2026-02-10 22:25:54 +00:00
d27c2b1259 Upload dynamic-styles.php via GUI 2026-02-10 22:25:53 +00:00
cc36e57079 Upload style.css via GUI 2026-02-10 22:25:49 +00:00
ca6955d579 Upload single-faq.php via GUI 2026-02-10 22:25:49 +00:00
ddbf78a5c0 Upload single.php via GUI 2026-02-10 22:25:48 +00:00
b3638449ea Upload page-login.php via GUI 2026-02-10 22:25:42 +00:00
863deb2592 Upload page.php via GUI 2026-02-10 22:25:41 +00:00
6 changed files with 3131 additions and 2732 deletions

View File

@@ -88,48 +88,329 @@ if ( get_theme_mod('slider_enabled', false) ) :
<?php endif; ?> <?php endif; ?>
<!-- ===================================================== --> <!-- ===================================================== -->
<!-- MAIN CONTENT --> <!-- MAIN CONTENT MIT SIDEBAR -->
<!-- ===================================================== --> <!-- ===================================================== -->
<main id="primary" class="site-main"> <main id="primary" class="site-main">
<div class="container"> <div class="container">
<div class="content-area">
<?php if ( have_posts() ) : ?> <?php
<?php while ( have_posts() ) : the_post(); ?> // Hole Sidebar-Einstellungen
$sidebar_enabled = get_theme_mod( 'homepage_sidebar_enabled', false );
$sidebar_position = get_theme_mod( 'homepage_sidebar_position', 'right' );
<article id="post-<?php the_ID(); ?>" <?php post_class( 'post' ); ?>> // Prüfe ob mindestens ein Sidebar-Bereich aktiv ist
$has_sidebar_content = (
is_active_sidebar( 'homepage-sidebar-top' ) ||
is_active_sidebar( 'homepage-sidebar-middle-1' ) ||
is_active_sidebar( 'homepage-sidebar-middle-2' ) ||
is_active_sidebar( 'homepage-sidebar-bottom' ) ||
is_active_sidebar( 'homepage-sidebar-extra' )
);
<?php if ( has_post_thumbnail() ) : ?> // Setze CSS-Klassen basierend auf Sidebar-Status
<div class="post-thumbnail"> $content_class = 'content-area';
<a href="<?php the_permalink(); ?>"> if ( $sidebar_enabled && $has_sidebar_content ) {
<?php the_post_thumbnail( 'medium_large' ); ?> $content_class = 'content-area with-sidebar sidebar-' . esc_attr( $sidebar_position );
</a> }
</div> ?>
<?php endif; ?>
<div class="post-content"> <div class="<?php echo esc_attr( $content_class ); ?>">
<h2 class="post-title">
<a href="<?php the_permalink(); ?>">
<?php the_title(); ?>
</a>
</h2>
<div class="post-full-content"> <?php if ( $sidebar_enabled && $sidebar_position === 'left' && $has_sidebar_content ) : ?>
<?php the_content(); ?> <!-- SIDEBAR LINKS -->
</div> <aside class="homepage-sidebar sidebar-left">
<?php if ( is_active_sidebar( 'homepage-sidebar-top' ) ) : ?>
<div class="sidebar-section sidebar-top">
<?php dynamic_sidebar( 'homepage-sidebar-top' ); ?>
</div> </div>
<?php endif; ?>
</article> <?php if ( is_active_sidebar( 'homepage-sidebar-middle-1' ) ) : ?>
<div class="sidebar-section sidebar-middle-1">
<?php dynamic_sidebar( 'homepage-sidebar-middle-1' ); ?>
</div>
<?php endif; ?>
<?php endwhile; ?> <?php if ( is_active_sidebar( 'homepage-sidebar-middle-2' ) ) : ?>
<?php else : ?> <div class="sidebar-section sidebar-middle-2">
<?php dynamic_sidebar( 'homepage-sidebar-middle-2' ); ?>
</div>
<?php endif; ?>
<p><?php esc_html_e( 'Keine Beiträge gefunden.', 'minecraft-modern-theme' ); ?></p> <?php if ( is_active_sidebar( 'homepage-sidebar-bottom' ) ) : ?>
<div class="sidebar-section sidebar-bottom">
<?php dynamic_sidebar( 'homepage-sidebar-bottom' ); ?>
</div>
<?php endif; ?>
<?php if ( is_active_sidebar( 'homepage-sidebar-extra' ) ) : ?>
<div class="sidebar-section sidebar-extra">
<?php dynamic_sidebar( 'homepage-sidebar-extra' ); ?>
</div>
<?php endif; ?>
</aside>
<?php endif; ?>
<!-- HAUPTINHALT -->
<div class="main-content">
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'post' ); ?>>
<?php if ( has_post_thumbnail() ) : ?>
<div class="post-thumbnail">
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail( 'medium_large' ); ?>
</a>
</div>
<?php endif; ?>
<div class="post-content">
<h2 class="post-title">
<a href="<?php the_permalink(); ?>">
<?php the_title(); ?>
</a>
</h2>
<div class="post-full-content">
<?php the_content(); ?>
</div>
</div>
</article>
<?php endwhile; ?>
<?php else : ?>
<p><?php esc_html_e( 'Keine Beiträge gefunden.', 'minecraft-modern-theme' ); ?></p>
<?php endif; ?>
</div>
<?php if ( $sidebar_enabled && $sidebar_position === 'right' && $has_sidebar_content ) : ?>
<!-- SIDEBAR RECHTS -->
<aside class="homepage-sidebar sidebar-right">
<?php if ( is_active_sidebar( 'homepage-sidebar-top' ) ) : ?>
<div class="sidebar-section sidebar-top">
<?php dynamic_sidebar( 'homepage-sidebar-top' ); ?>
</div>
<?php endif; ?>
<?php if ( is_active_sidebar( 'homepage-sidebar-middle-1' ) ) : ?>
<div class="sidebar-section sidebar-middle-1">
<?php dynamic_sidebar( 'homepage-sidebar-middle-1' ); ?>
</div>
<?php endif; ?>
<?php if ( is_active_sidebar( 'homepage-sidebar-middle-2' ) ) : ?>
<div class="sidebar-section sidebar-middle-2">
<?php dynamic_sidebar( 'homepage-sidebar-middle-2' ); ?>
</div>
<?php endif; ?>
<?php if ( is_active_sidebar( 'homepage-sidebar-bottom' ) ) : ?>
<div class="sidebar-section sidebar-bottom">
<?php dynamic_sidebar( 'homepage-sidebar-bottom' ); ?>
</div>
<?php endif; ?>
<?php if ( is_active_sidebar( 'homepage-sidebar-extra' ) ) : ?>
<div class="sidebar-section sidebar-extra">
<?php dynamic_sidebar( 'homepage-sidebar-extra' ); ?>
</div>
<?php endif; ?>
</aside>
<?php endif; ?> <?php endif; ?>
</div> </div>
</div> </div>
</main> </main>
<!-- ===================================================== -->
<!-- ZUSÄTZLICHES CSS FÜR SIDEBAR LAYOUT -->
<!-- ===================================================== -->
<style>
/* Content ohne Sidebar - volle Breite */
.content-area .main-content {
width: 100%;
margin-bottom: 40px;
}
/* Container mit Sidebar-Layout */
.content-area.with-sidebar {
display: grid;
gap: 30px;
align-items: start;
}
/* Sidebar rechts (Standard) */
.content-area.with-sidebar.sidebar-right {
grid-template-columns: 1fr 300px;
}
.content-area.with-sidebar.sidebar-right .main-content {
order: 1;
}
.content-area.with-sidebar.sidebar-right .homepage-sidebar {
order: 2;
}
/* Sidebar links */
.content-area.with-sidebar.sidebar-left {
grid-template-columns: 300px 1fr;
}
.content-area.with-sidebar.sidebar-left .homepage-sidebar {
order: 1;
}
.content-area.with-sidebar.sidebar-left .main-content {
order: 2;
}
/* Entfernt das Sticky-Verhalten der Sidebar komplett */
.homepage-sidebar {
position: relative !important;
top: auto !important;
background: var(--card-background, #1e2029);
border-radius: 8px;
padding: 20px;
overflow-y: auto;
max-height: calc(200vh - 10vh);
}
/* Sidebar Sections - Bereiche innerhalb der Sidebar */
.homepage-sidebar .sidebar-section {
margin-bottom: 30px;
padding-bottom: 20px;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.homepage-sidebar .sidebar-section:last-child {
margin-bottom: 0;
padding-bottom: 0;
border-bottom: none;
}
/* Spezielle Styling für bestimmte Bereiche */
.homepage-sidebar .sidebar-top {
border-bottom: 2px solid var(--primary-accent, #00d4ff);
}
.homepage-sidebar .sidebar-bottom {
padding-top: 20px;
border-top: 2px solid var(--primary-accent, #00d4ff);
border-bottom: none;
}
.homepage-sidebar .widget {
margin-bottom: 20px;
}
.homepage-sidebar .widget:last-child {
margin-bottom: 0;
}
.homepage-sidebar .widget-title {
font-size: 1.2rem;
margin-bottom: 15px;
padding-bottom: 10px;
border-bottom: 2px solid var(--primary-accent, #00d4ff);
color: var(--primary-accent, #00d4ff);
}
.homepage-sidebar ul {
list-style: none;
padding: 0;
margin: 0;
}
.homepage-sidebar ul li {
padding: 8px 0;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.homepage-sidebar ul li:last-child {
border-bottom: none;
}
.homepage-sidebar a {
color: inherit;
text-decoration: none;
transition: color 0.2s ease;
}
.homepage-sidebar a:hover {
color: var(--primary-accent, #00d4ff);
}
/* Mobile: Sidebar unter Content */
@media (max-width: 768px) {
.content-area.with-sidebar.sidebar-right,
.content-area.with-sidebar.sidebar-left {
grid-template-columns: 1fr;
}
.content-area.with-sidebar .homepage-sidebar {
order: 3 !important; /* Immer unten auf mobilen Geräten */
position: relative;
top: 0;
max-height: none;
}
.content-area.with-sidebar .main-content {
order: 1 !important;
}
}
/* Dark Mode Anpassungen */
body.dark-mode .homepage-sidebar {
background: #1e1e1e;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
body.dark-mode .homepage-sidebar ul li {
border-bottom-color: rgba(255, 255, 255, 0.1);
}
/* Light Mode Anpassungen */
body.light-mode .homepage-sidebar {
background: #ffffff;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
body.light-mode .homepage-sidebar .sidebar-section {
border-bottom-color: rgba(0, 0, 0, 0.1);
}
body.light-mode .homepage-sidebar ul li {
border-bottom-color: rgba(0, 0, 0, 0.1);
}
body.light-mode .homepage-sidebar .widget-title {
color: var(--primary-accent, #00d4ff);
}
/* Scrollbar Styling für Sidebar */
.homepage-sidebar::-webkit-scrollbar {
width: 6px;
}
.homepage-sidebar::-webkit-scrollbar-track {
background: rgba(0, 0, 0, 0.1);
border-radius: 3px;
}
.homepage-sidebar::-webkit-scrollbar-thumb {
background: var(--primary-accent, #00d4ff);
border-radius: 3px;
}
.homepage-sidebar::-webkit-scrollbar-thumb:hover {
background: var(--primary-accent-hover, #00b8e6);
}
</style>
<?php get_footer(); ?> <?php get_footer(); ?>

View File

@@ -168,6 +168,65 @@ function minecraft_modern_footer_widgets() {
} }
add_action( 'widgets_init', 'minecraft_modern_footer_widgets' ); add_action( 'widgets_init', 'minecraft_modern_footer_widgets' );
// === Homepage Sidebar registrieren ===
function minecraft_modern_homepage_sidebar() {
// Hauptbereich oben
register_sidebar( array(
'name' => __( 'Startseiten Sidebar - Oben', 'minecraft-modern-theme' ),
'id' => 'homepage-sidebar-top',
'description' => __( 'Widget-Bereich oben in der Sidebar (z.B. für wichtige Infos).', 'minecraft-modern-theme' ),
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
// Mittlerer Bereich 1
register_sidebar( array(
'name' => __( 'Startseiten Sidebar - Mitte 1', 'minecraft-modern-theme' ),
'id' => 'homepage-sidebar-middle-1',
'description' => __( 'Widget-Bereich in der Mitte der Sidebar.', 'minecraft-modern-theme' ),
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
// Mittlerer Bereich 2
register_sidebar( array(
'name' => __( 'Startseiten Sidebar - Mitte 2', 'minecraft-modern-theme' ),
'id' => 'homepage-sidebar-middle-2',
'description' => __( 'Zweiter Widget-Bereich in der Mitte der Sidebar.', 'minecraft-modern-theme' ),
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
// Unterer Bereich
register_sidebar( array(
'name' => __( 'Startseiten Sidebar - Unten', 'minecraft-modern-theme' ),
'id' => 'homepage-sidebar-bottom',
'description' => __( 'Widget-Bereich unten in der Sidebar (z.B. für Social Media).', 'minecraft-modern-theme' ),
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
// Zusätzlicher flexibler Bereich
register_sidebar( array(
'name' => __( 'Startseiten Sidebar - Extra', 'minecraft-modern-theme' ),
'id' => 'homepage-sidebar-extra',
'description' => __( 'Zusätzlicher Widget-Bereich für spezielle Inhalte.', 'minecraft-modern-theme' ),
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
}
add_action( 'widgets_init', 'minecraft_modern_homepage_sidebar' );
// === FAQ Custom Post Type & Taxonomy === // === FAQ Custom Post Type & Taxonomy ===
function create_faq_post_type() { function create_faq_post_type() {
// Nur registrieren, wenn im Customizer aktiviert // Nur registrieren, wenn im Customizer aktiviert

View File

@@ -9,6 +9,7 @@
* - Social Media * - Social Media
* - Footer * - Footer
* - Login * - Login
* - Sidebar
* - Import/Export * - Import/Export
*/ */
@@ -198,7 +199,47 @@ function minecraft_modern_customize_register( $wp_customize ) {
// ========================================================================= // =========================================================================
// === 3. SOCIAL MEDIA ===================================================== // === 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',
'type' => 'checkbox',
) );
// Sidebar Position
$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',
),
) );
// =========================================================================
// === 4. SOCIAL MEDIA =====================================================
// ========================================================================= // =========================================================================
$wp_customize->add_section( 'social_links', array( 'title' => 'Social Media Links', 'priority' => 40 ) ); $wp_customize->add_section( 'social_links', array( 'title' => 'Social Media Links', 'priority' => 40 ) );
@@ -212,7 +253,7 @@ function minecraft_modern_customize_register( $wp_customize ) {
// ========================================================================= // =========================================================================
// === 4. FOOTER-BEREICH ================================================== // === 5. FOOTER-BEREICH ==================================================
// ========================================================================= // =========================================================================
$wp_customize->add_section( 'footer_settings', array( 'title' => 'Footer-Einstellungen', 'priority' => 50 ) ); $wp_customize->add_section( 'footer_settings', array( 'title' => 'Footer-Einstellungen', 'priority' => 50 ) );
@@ -241,7 +282,7 @@ function minecraft_modern_customize_register( $wp_customize ) {
// ========================================================================= // =========================================================================
// === 5. ZUSÄTZLICHE FUNKTIONEN ========================================== // === 6. ZUSÄTZLICHE FUNKTIONEN ==========================================
// ========================================================================= // =========================================================================
// --- Sektion: FAQ Einstellungen --- // --- Sektion: FAQ Einstellungen ---
@@ -251,7 +292,7 @@ function minecraft_modern_customize_register( $wp_customize ) {
'label' => 'FAQ System aktivieren', 'section' => 'faq_settings', 'settings' => 'faq_enabled', 'type' => 'checkbox', 'label' => 'FAQ System aktivieren', 'section' => 'faq_settings', 'settings' => 'faq_enabled', 'type' => 'checkbox',
) ); ) );
// --- Sektion: Team Einstellungen --- // --- Sektion: Team Einstellungen ---
$wp_customize->add_section( 'team_settings', array( 'title' => 'Team Einstellungen', 'priority' => 65 ) ); $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_setting( 'team_enabled', array( 'default' => true, 'sanitize_callback' => 'wp_validate_boolean' ) );
$wp_customize->add_control( 'team_enabled', array( $wp_customize->add_control( 'team_enabled', array(
@@ -259,7 +300,7 @@ function minecraft_modern_customize_register( $wp_customize ) {
) ); ) );
// ========================================================================= // =========================================================================
// === 6. LOGIN-BEREICH ==================================================== // === 7. LOGIN-BEREICH ====================================================
// ========================================================================= // =========================================================================
$wp_customize->add_section( 'login_settings', array( $wp_customize->add_section( 'login_settings', array(
@@ -321,7 +362,7 @@ function minecraft_modern_customize_register( $wp_customize ) {
) ); ) );
// ========================================================================= // =========================================================================
// === 7. EXPORT / IMPORT SECTION ========================================= // === 8. EXPORT / IMPORT SECTION =========================================
// ========================================================================= // =========================================================================
$wp_customize->add_section( 'theme_mods_import_export', array( $wp_customize->add_section( 'theme_mods_import_export', array(

View File

@@ -5,8 +5,23 @@ if ( ! defined( 'ABSPATH' ) ) {
exit; exit;
} }
// === ZENTRALE VERSIONSKONSTANTE === // === THEME VERSION AUTOMATISCH AUS style.css LADEN (PARENT THEME PRIORITÄT) ===
define( 'MINECRAFT_MODERN_THEME_VERSION', '1.6' ); function minecraft_modern_get_theme_version() {
// Holt das aktuell aktive Theme (child oder parent)
$theme = wp_get_theme();
// Wenn ein Child-Theme aktiv ist und ein Parent vorhanden ist, nutze die Parent-Version
$parent = $theme->parent();
if ( $parent && $parent->exists() ) {
$parent_version = $parent->get( 'Version' );
if ( ! empty( $parent_version ) ) {
return $parent_version;
}
}
// Fallback: Version des aktuell aktiven Themes (wenn kein Parent existiert oder Parent keine Version hat)
return $theme->get( 'Version' );
}
// === THEME UPDATE NOTIFICATION SYSTEM === // === THEME UPDATE NOTIFICATION SYSTEM ===
@@ -34,7 +49,10 @@ function minecraft_modern_get_latest_release_info( $force_refresh = false ) {
if ( false === $release_info ) { if ( false === $release_info ) {
// Timeout auf 10 Sekunden erhöht für langsame Verbindungen // Timeout auf 10 Sekunden erhöht für langsame Verbindungen
$response = wp_remote_get( 'https://git.viper.ipv64.net/api/v1/repos/M_Viper/Minecraft-Modern-Theme/releases/latest', array( 'timeout' => 10 ) ); $response = wp_remote_get(
'https://git.viper.ipv64.net/api/v1/repos/M_Viper/Minecraft-Modern-Theme/releases/latest',
array( 'timeout' => 10 )
);
if ( ! is_wp_error( $response ) && 200 === wp_remote_retrieve_response_code( $response ) ) { if ( ! is_wp_error( $response ) && 200 === wp_remote_retrieve_response_code( $response ) ) {
$body = wp_remote_retrieve_body( $response ); $body = wp_remote_retrieve_body( $response );
@@ -54,7 +72,7 @@ function minecraft_modern_get_latest_release_info( $force_refresh = false ) {
'published_at' => isset( $release_data['published_at'] ) ? $release_data['published_at'] : '' 'published_at' => isset( $release_data['published_at'] ) ? $release_data['published_at'] : ''
); );
// Cache für 6 Stunden (kannst du anpassen) // Cache für 6 Stunden
set_transient( $transient_key, $release_info, 6 * HOUR_IN_SECONDS ); set_transient( $transient_key, $release_info, 6 * HOUR_IN_SECONDS );
} else { } else {
// Fehlerhafte Daten leer cachen // Fehlerhafte Daten leer cachen
@@ -69,13 +87,13 @@ function minecraft_modern_get_latest_release_info( $force_refresh = false ) {
return $release_info; return $release_info;
} }
// Benachrichtigung im Admin-Bereich // === BENACHRICHTIGUNG IM ADMIN-BEREICH ===
function minecraft_modern_show_update_notification() { function minecraft_modern_show_update_notification() {
if ( ! is_admin() || ! current_user_can( 'manage_options' ) ) { if ( ! is_admin() || ! current_user_can( 'manage_options' ) ) {
return; return;
} }
$current_version = MINECRAFT_MODERN_THEME_VERSION; $current_version = minecraft_modern_get_theme_version();
$latest_release = minecraft_modern_get_latest_release_info(); $latest_release = minecraft_modern_get_latest_release_info();
if ( ! empty( $latest_release ) && isset( $latest_release['version'] ) && version_compare( $current_version, $latest_release['version'], '<' ) ) { if ( ! empty( $latest_release ) && isset( $latest_release['version'] ) && version_compare( $current_version, $latest_release['version'], '<' ) ) {
@@ -105,7 +123,7 @@ function minecraft_modern_show_update_notification() {
} }
add_action( 'admin_notices', 'minecraft_modern_show_update_notification' ); add_action( 'admin_notices', 'minecraft_modern_show_update_notification' );
// Dashboard Widget // === DASHBOARD WIDGET ===
function minecraft_modern_add_dashboard_widget() { function minecraft_modern_add_dashboard_widget() {
wp_add_dashboard_widget( wp_add_dashboard_widget(
'minecraft_modern_update_widget', 'minecraft_modern_update_widget',
@@ -116,7 +134,7 @@ function minecraft_modern_add_dashboard_widget() {
add_action( 'wp_dashboard_setup', 'minecraft_modern_add_dashboard_widget' ); add_action( 'wp_dashboard_setup', 'minecraft_modern_add_dashboard_widget' );
function minecraft_modern_update_widget_function() { function minecraft_modern_update_widget_function() {
$current_version = MINECRAFT_MODERN_THEME_VERSION; $current_version = minecraft_modern_get_theme_version();
$latest_release = minecraft_modern_get_latest_release_info(); $latest_release = minecraft_modern_get_latest_release_info();
echo '<p><strong>' . __( 'Current Version:', 'minecraft-modern-theme' ) . '</strong> ' . esc_html( $current_version ) . '</p>'; echo '<p><strong>' . __( 'Current Version:', 'minecraft-modern-theme' ) . '</strong> ' . esc_html( $current_version ) . '</p>';
@@ -125,16 +143,16 @@ function minecraft_modern_update_widget_function() {
echo '<p><strong>' . __( 'Latest Version:', 'minecraft-modern-theme' ) . '</strong> ' . esc_html( $latest_release['version'] ) . '</p>'; echo '<p><strong>' . __( 'Latest Version:', 'minecraft-modern-theme' ) . '</strong> ' . esc_html( $latest_release['version'] ) . '</p>';
if ( version_compare( $current_version, $latest_release['version'], '<' ) ) { if ( version_compare( $current_version, $latest_release['version'], '<' ) ) {
echo '<p><strong>' . __( 'Status:', 'minecraft-modern-theme' ) . '</strong> <span style="color: #d63638;">' . __( 'Update Available', 'minecraft-modern-theme' ) . '</span></p>'; echo '<p><strong>' . __( 'Status:', 'minecraft-modern-theme' ) . '</strong> <span style="color:#d63638;">' . __( 'Update Available', 'minecraft-modern-theme' ) . '</span></p>';
echo '<p><a href="' . esc_url( $latest_release['download_url'] ) . '" class="button button-primary" target="_blank">' . __( 'Download Update', 'minecraft-modern-theme' ) . '</a></p>'; echo '<p><a href="' . esc_url( $latest_release['download_url'] ) . '" class="button button-primary" target="_blank">' . __( 'Download Update', 'minecraft-modern-theme' ) . '</a></p>';
} else { } else {
echo '<p><strong>' . __( 'Status:', 'minecraft-modern-theme' ) . '</strong> <span style="color: #46b450;">' . __( 'Up to Date', 'minecraft-modern-theme' ) . '</span></p>'; echo '<p><strong>' . __( 'Status:', 'minecraft-modern-theme' ) . '</strong> <span style="color:#46b450;">' . __( 'Up to Date', 'minecraft-modern-theme' ) . '</span></p>';
} }
} else { } else {
echo '<p><strong>' . __( 'Status:', 'minecraft-modern-theme' ) . '</strong> ' . __( 'Unable to check for updates', 'minecraft-modern-theme' ) . '</p>'; echo '<p><strong>' . __( 'Status:', 'minecraft-modern-theme' ) . '</strong> ' . __( 'Unable to check for updates', 'minecraft-modern-theme' ) . '</p>';
} }
// Link für "Jetzt prüfen" hinzugefügt // Link für "Jetzt prüfen"
$refresh_url = wp_nonce_url( admin_url( 'index.php?mm_clear_cache=1' ), 'mm_clear_cache_action' ); $refresh_url = wp_nonce_url( admin_url( 'index.php?mm_clear_cache=1' ), 'mm_clear_cache_action' );
echo '<p><a href="' . esc_url( $refresh_url ) . '" onclick="return confirm(\'Cache leeren und neu prüfen?\');">' . __( 'Check for Updates Now', 'minecraft-modern-theme' ) . '</a></p>'; echo '<p><a href="' . esc_url( $refresh_url ) . '" onclick="return confirm(\'Cache leeren und neu prüfen?\');">' . __( 'Check for Updates Now', 'minecraft-modern-theme' ) . '</a></p>';

View File

@@ -4,7 +4,7 @@ Theme URI: https://git.viper.ipv64.net/M_Viper/Minecraft-Modern-Theme
Author: M_Viper Author: M_Viper
Description: Ein modernes Gaming-Theme mit konfigurierbarem Header-Slider. Description: Ein modernes Gaming-Theme mit konfigurierbarem Header-Slider.
Author URI: https://M-Viper.de Author URI: https://M-Viper.de
Version: 1.6 Version: 1.9
License: GNU General Public License v2 or later License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: minecraft-modern-theme Text Domain: minecraft-modern-theme