1 Star 2 Fork 0

ZAXU/zaxu-child

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
color-scheme.php 1.94 KB
一键复制 编辑 原始数据 按行查看 历史
Muiteer 提交于 2024-05-29 20:44 . Released 1.1.9
<?php
/*
* @Description: Color scheme
* @Version: 1.1.9
* @Author: ZAXU
* @Link: https://www.zaxu.com
* @Package: ZAXU
*/
if ( !defined('ABSPATH') ) exit;
add_action('wp_enqueue_scripts', function() {
// Color scheme value start
if ( function_exists('zaxu_color_scheme_value') ) {
$bg_color = zaxu_color_scheme_value()[0];
$txt_color = zaxu_color_scheme_value()[1];
$acc_color = zaxu_color_scheme_value()[2];
} else {
$bg_color = null;
$txt_color = null;
$acc_color = null;
}
// Color scheme value end
if (get_theme_mod('zaxu_dynamic_color', 'disabled') == 'disabled') {
// General color start
$custom_css = "
/* General color css code starts here */
";
// General color end
} else {
// Dynamic color start
$custom_css = "
/* Dynamic color css code starts here */
";
// Dynamic color end
if ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) {
if ( strpos($_SERVER['HTTP_USER_AGENT'], "Triden") ) {
// IE browser start
$custom_css = "
/* IE browser css code starts here */
";
// IE browser end
}
}
}
if (get_theme_mod('zaxu_minify_engine', 'enabled') == 'enabled') {
$custom_css = str_replace(
array(
"\rn",
"\r",
"\n",
"\t",
' ',
' ',
' '
),
'',
$custom_css
);
$custom_css = preg_replace('/\/\*.*?\*\//s', '', $custom_css);
}
wp_register_style('zaxu-child-color-scheme', false);
wp_enqueue_style('zaxu-child-color-scheme');
wp_add_inline_style('zaxu-child-color-scheme', $custom_css);
}, 999);
?>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/zaxu/zaxu-child.git
git@gitee.com:zaxu/zaxu-child.git
zaxu
zaxu-child
zaxu-child
master

搜索帮助