feat: 升级版本至1.4.0并添加外部资源备用机制
- 版本号从1.3.5升级至1.4.0 - 创建外部资源备用加载系统,解决国内访问问题 - 添加Google Fonts本地备用字体文件 - 集成Geetest验证码本地备用版本 - 实现QRCode.js本地备用功能 - 创建智能资源加载器,自动切换到本地资源 - 修改所有外部资源引用,支持自动备用机制 - 添加资源配置文件,便于管理和维护
This commit is contained in:
14
header.php
14
header.php
@@ -269,8 +269,20 @@
|
||||
wp_enqueue_style("argon_css_merged", $GLOBALS['assets_path'] . "/assets/argon_css_merged.css", null, $GLOBALS['theme_version']);
|
||||
|
||||
wp_enqueue_style("style", $GLOBALS['assets_path'] . "/style.css", null, $GLOBALS['theme_version']);
|
||||
|
||||
// 集成外部资源备用机制
|
||||
wp_enqueue_script("resource_loader", $GLOBALS['assets_path'] . "/assets/vendor/external/resource-loader.js", null, $GLOBALS['theme_version']);
|
||||
|
||||
if (get_option('argon_disable_googlefont') != 'true') {wp_enqueue_style("googlefont", "//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700|Noto+Serif+SC:300,600&display=swap");}
|
||||
if (get_option('argon_disable_googlefont') != 'true') {
|
||||
// 使用备用机制加载Google Fonts
|
||||
echo '<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
if (typeof ArgonResourceLoader !== "undefined") {
|
||||
ArgonResourceLoader.smartLoad("//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700|Noto+Serif+SC:300,600&display=swap", "css");
|
||||
}
|
||||
});
|
||||
</script>';
|
||||
}
|
||||
|
||||
// 加载 argon_js_merged(包含 jQuery 和其他库)
|
||||
wp_enqueue_script("argon_js_merged", $GLOBALS['assets_path'] . "/assets/argon_js_merged.js", null, $GLOBALS['theme_version']);
|
||||
|
||||
Reference in New Issue
Block a user