0 && isset($_COOKIE['aksrt_notice_seen'])) { $seen_ts = absint($_COOKIE['aksrt_notice_seen']); if ($seen_ts > 0 && (time() - $seen_ts) < ($expires_hours * 3600)) { return false; } } return true; } /** * Render the notice popup in footer */ public function render_notice(): void { if (!$this->is_active()) return; $cfg = AKSRT_Settings::get_system_notice_config(); $content = wp_kses_post($cfg['content']); $title = esc_html($cfg['title'] ?: __('站点公告', 'aksrt')); $extra_cls = $cfg['class'] ? ' ' . esc_attr($cfg['class']) : ''; $radius = absint($cfg['radius']); $size_cls = $cfg['size']; // 标题图标 / 样式 $title_icon = $cfg['title_icon']; $title_cls = $cfg['title_class'] ? ' ' . esc_attr($cfg['title_class']) : ''; $title_style = $cfg['title_style'] ? ' style="' . esc_attr($cfg['title_style']) . '"' : ''; // 弹窗尺寸 class $dialog_cls = 'aksrt-site-notice__dialog'; if ($size_cls !== '') { $dialog_cls .= ' ' . esc_attr($size_cls); } // 内联样式:圆角 $dialog_style = 'display:none;'; if ($radius > 0) { $dialog_style .= 'border-radius:' . $radius . 'px;'; } $buttons = $cfg['buttons']; ?>