From 68b62fa142dfd6d8f824cbcd90afd243b9c4bc1b Mon Sep 17 00:00:00 2001 From: nanhaoluo <3075912108@qq.com> Date: Thu, 15 Jan 2026 15:51:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=88=B7=E6=96=B0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增自动刷新选项,检测到版本更新时自动刷新用户浏览器 - 使用 localStorage 存储版本号进行比对 - 设置5秒冷却期防止刷新循环 - 刷新前清理浏览器 Service Worker 缓存 --- functions.php | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++ settings.php | 16 +++++++++++++++ 2 files changed, 73 insertions(+) diff --git a/functions.php b/functions.php index 9e88a91..a404563 100644 --- a/functions.php +++ b/functions.php @@ -335,6 +335,63 @@ function argon_frontend_hot_reload_notice() { } add_action('wp_footer', 'argon_frontend_hot_reload_notice'); +// 前端自动刷新脚本 +function argon_hot_reload_auto_refresh_script() { + if (get_option('argon_enable_hot_reload', 'false') != 'true') { + return; + } + if (get_option('argon_hot_reload_auto_refresh', 'false') != 'true') { + return; + } + + $current_version = $GLOBALS['theme_version']; + ?> + + + + + +

+ + +