hooks(); // Doors custom post type + meta boxes. $doors = new ADVK_Doors_CPT(); $doors->hooks(); // Settings page (tweaks + texts + today override). $settings = new ADVK_Settings(); $settings->hooks(); // Frontend shortcode + asset enqueue. $shortcode = new ADVK_Shortcode(); $shortcode->hooks(); // AJAX submission handler. $ajax = new ADVK_Ajax(); $ajax->hooks(); // Admin submissions view. $entries_admin = new ADVK_Admin_Entries(); $entries_admin->hooks(); // Winner drawing admin page. $winners = new ADVK_Winners(); $winners->hooks(); // Redesigned admin chrome (branded navigation + "Mitternacht" theme). if ( is_admin() ) { $admin_ui = new ADVK_Admin_UI(); $admin_ui->hooks(); // Custom "Türchen" overview page (grid/list of door cards). $doors_admin = new ADVK_Doors_Admin(); $doors_admin->hooks(); // Custom door editor (replaces the native CPT edit screen). $door_editor = new ADVK_Door_Editor(); $door_editor->hooks(); } // Confirmation / notification e-mails. $emails = new ADVK_Emails(); $emails->hooks(); // Gutenberg block. $block = new ADVK_Block(); $block->hooks(); // DSGVO / GDPR tooling. $privacy = new ADVK_Privacy(); $privacy->hooks(); // Newsletter provider integration. $newsletter = new ADVK_Newsletter(); $newsletter->hooks(); // Reminder opt-in + daily cron. $reminders = new ADVK_Reminders(); $reminders->hooks(); // "Go Pro" pointer (auto-hides when the Pro add-on is active). $upsell = new ADVK_Upsell(); $upsell->hooks(); // Run on both admin and front end so the schema is migrated before any // frontend entry is stored after an in-place update (the version check // makes this a no-op once migrated). add_action( 'admin_init', array( $this, 'maybe_upgrade_db' ) ); add_action( 'init', array( $this, 'maybe_upgrade_db' ) ); } /** * Run dbDelta when the stored schema version is behind the plugin version. * Keeps the entries table (e.g. the is_winner column) up to date after an * in-place update without requiring re-activation. */ public function maybe_upgrade_db() { $installed = get_option( 'advk_db_version' ); if ( ADVK_VERSION !== $installed ) { ADVK_Entries::create_table(); update_option( 'advk_db_version', ADVK_VERSION ); } // Schema revision is tracked separately from the plugin version so table // migrations (e.g. the `calendar` column) still run after an in-place // update that keeps the same version string. dbDelta only adds what is // missing, so this is a no-op once migrated. if ( (int) get_option( 'advk_db_schema', 0 ) < ADVK_Entries::SCHEMA ) { ADVK_Entries::create_table(); update_option( 'advk_db_schema', ADVK_Entries::SCHEMA ); } } }